How to debug child Node.JS process in VS Code?
Here is the example of the code that I\'m trying to debug:
var spawn = require(\'child_process\').spawn;
var s
You can easily add a new launch configuration to launch.json that allows you to attach to a running node instance with a specific port:
{
"name": "Attach to Node",
"type": "node",
"address": "localhost",
"port": 5870,
}
Just make sure you fork/spawn your node process with the --debug or --debug-brk argument.