Debug an already running node.js process on Windows

331 views Asked by At

On Linux/Unix platforms it is possible to put a node.js process in debug mode by sending it the USR1 signal. Windows does not have the same signalling model, so is there any way to place an already running node.js process in debug mode on Windows? (in other words, I want to avoid having to restart the process and pass it the debug flag)

1

There are 1 answers

1
Ben Taber On

Have you tried writing a node script and using process.kill(pid, 'SIGUSR1')? I have no idea if this will work as desired on windows, but worth a try.

Note that Windows does not support sending Signals, but node offers some emulation with process.kill(), and child_process.kill(): - Sending signal 0 can be used to search for the existence of a process - Sending SIGINT, SIGTERM, and SIGKILL cause the unconditional exit of the target process.

http://nodejs.org/api/process.html#process_signal_events