SIGHUP is not supported on Windows
Closed this issue · 1 comments
fasttime commented
Windows 10
Node.js 18.0.0
foreground-child 2.0.0
When the parent process terminates, it sends a SIGHUP
signal to kill the child:
Line 58 in a6704d9
This is failing on Windows, apparently because SIGHUP
is not supported:
Error: kill ENOSYS
at ChildProcess.kill (node:internal/child_process:501:13)
The error message is not helpful, but a comment line in the source code of child_process explains it:
https://github.com/nodejs/node/blob/v18.0.0/lib/internal/child_process.js#L500-L501
/* The underlying platform doesn't support this signal. */
throw errnoException(err, 'kill');
Maybe send SIGTERM
on Windows and SIGHUP
on other platforms?