node-bunyan
node-bunyan copied to clipboard
CLI fails on Windows due to invalid signal binds
If I run the bunyan CLI on Windows it fails since it attempts to bind signals that have no Windows equivalent:
deno install -fg --root "$PWD/deno/tools" --allow-{read,write,env} --allow-sys "npm:[email protected]"
$ ./deno/tools/bin/bunyan --color
error: Uncaught TypeError: Windows only supports ctrl-c (SIGINT) and ctrl-break (SIGBREAK).
at bindSignal (ext:runtime/40_signals.js:14:10)
at Object.addSignalListener (ext:runtime/40_signals.js:54:19)
at Process.on (node:process:349:12)
at Object.<anonymous> (file:///C:/Users/davide.depau/AppData/Local/deno/npm/registry.npmjs.org/bunyan/1.8.15/bin/bunyan:1532:9)
at Object.<anonymous> (file:///C:/Users/davide.depau/AppData/Local/deno/npm/registry.npmjs.org/bunyan/1.8.15/bin/bunyan:1706:4)
at Module._compile (node:module:729:34)
at Object.Module._extensions..js (node:module:743:10)
at Module.load (node:module:654:32)
at Function.Module._load (node:module:522:12)
at Object.loadCjsModule (ext:deno_node/02_init.js:64:22)
The problem is that Bunyan binds these:
process.on('SIGINT', function () { cleanupAndExit(1, 'SIGINT'); });
process.on('SIGQUIT', function () { cleanupAndExit(1, 'SIGQUIT'); });
process.on('SIGTERM', function () { cleanupAndExit(1, 'SIGTERM'); });
process.on('SIGHUP', function () { cleanupAndExit(1, 'SIGHUP'); });
Most of them shouldn't be bound on Windows.