简体   繁体   中英

How to debug Node.js with Firefox?

I'm aware of how to access the Chrome Dev Tools with Google Chrome to debug Node.js applications: just go to about://inspect.

I encountered a line of text on MDN mentioning that Firefox could be used for Node.js applications, but going to about://inspect in Firefox doesn't work. I'd like to know how this would be done in Firefox, if it is indeed possible.

Because Firefox uses a different Javascript engine (Gecko) than Node.js (V8), it's impossible to use the Firefox dev tools to debug Node scripts. As of this post, MDN says as much in their "Remote Debugging" article:

You can connect the developer tools to Gecko-based runtimes...

https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging

There's a tool called node-firefox that you can use for that, you can download it from:

npm install node-firefox

Here's the source code: https://github.com/mozilla/node-firefox

And a introductory guide: https://hacks.mozilla.org/2015/02/introducing-node-firefox/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM