Ok here is the answer: How to debug Node.JS child forked process?
In Short: It is a bug in node.js v0.10 where it is impossible to debug child processes.
But it is still possible to debug the childprocess also:
And as a amendment here is my solution:
Change the code inside launcher.js to fork the childprocess with --debug-brk
also! And give it a unique port as explained in the posted link above.
Then you need to set a breakpoint (or put debugger;
inside the code) before the childFork.process.send('run',...)
function to stop the code from sending the message to the forked process.
This is needed because you have stopped the childprocess from running by setting --debug-brk
. So connect to the second process and hit continue. You will see that the childprocess (runFromLauncher) will wait until message 'run' is received. and so switch back to the first debugger, hit run and let it send the message to the childprocess.
You will see, if you set a breakpoint inside the process.on.message(...)
function in runFromLauncher.js, you can step through the code again.