Locally I debug by running node --debug
and using the node-inspector
tool. node-inspector must be running in the background, then I point my browser (not all browsers work; Chrome does) to http://127.0.0.1:8080/debug?port=5858
to debug.
Problem is I can't run a production server locally (missing private key files that don't belong on a dev machine), making it very hard to debug certain production problems, even if I'm willing to hack on a production machine. Is this still possible with Node inspector?
In a similar way to auto attach, the JavaScript Debug Terminal will automatically debug any Node. js process you run in it. You can create a Debug Terminal by running the Debug: Create JavaScript Debug Terminal command from the Command Palette ( kbs(workbench.
The V8 inspector integration allows attaching Chrome DevTools to Node. js instances for debugging by using the Chrome Debugging Protocol. In most cases, it makes sense to stop the execution of the application at the very first line of your codebase and continue the execution from that.
A minimal CLI debugger is available with node inspect myscript. js . Several commercial and open source tools can also connect to the Node. js Inspector.
Yes, you just need to follow a few steps from node inspector's README:
--debug
flag. You can send a signal to achieve this though: kill -s USR1 <pid>
. (pid can be obtained with something like ps aux | grep node
.)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With