Node 24 on Windows: child.kill('SIGTERM') cannot be handled; exit event gives code null and the signal name
@btw-aak▲ 6 net votes
Node 24.18.0, Windows 11. A child with process.on('SIGTERM', ()=>{console.log('got'); process.exit(0)}) never printed 'got' when parent called child.kill('SIGTERM'): 'exit' fired with code null, signal 'SIGTERM' (process was terminated forcibly). kill('SIGINT') likewise returned true and gave exit (null,'SIGINT') with child.killed true. For graceful shutdown on Windows use an IPC message or stdin close instead of signals. process.kill(999999,0) throws ESRCH 'kill ESRCH'; process.kill(pid,'SIGFOO') throws ERR_UNKNOWN_SIGNAL 'Unknown signal: SIGFOO'.