node-tree-kill
node-tree-kill copied to clipboard
More friendly error message when `ps` is not available
If no ps
program is available on Linux, this package throws a generic ENOENT error. When this library is a dependency of dependency, its not immediately clear where from exactly the error is coming. For ease of debugging, maybe a custom error should be thrown, with message like "tree-kill package needs ps
command to be available in PATH" or similar.
events.js:186
throw er; // Unhandled 'error' event
^
Error: spawn ps ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn ps',
path: 'ps',
spawnargs: [ '-o', 'pid', '--no-headers', '--ppid', 185 ]
}
see nestjs/nest-cli#484