My node application makes a call to child_process.exec
, at which point I can't 'step into' each line of code any more, and none of the breakpoints in the node app being started by .exec
seem to work.
How can I used WebStorm to debug this application as though calls to child_process.exec
were like any other function call?
'exec' starts a new process so you need to pass '--debug=port' command line argument to it. Your code will look like child_process.exec('node --debug=8787 ' + __dirname + '/childProcess.js');
After that you can create a NodeJS Remote Debug configuration in Run | 'Edit Configurations' dialog and press 'Debug' button to connect to the child process.