You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] SIGINT (ctrl+c) makes npm 7 print error log #2124
If I stop a process started by an npm script (with ctrl+c) , its stops, but npm prints error log.
Expected Behavior:
Normal (silent) exit
Steps To Reproduce:
execute any package script and ctrl+c on it.
example:
"start": "sleep 100"
ERR! path /home/jonathan/Workspace/test
npm ERR! command failed
npm ERR! signal SIGINT
npm ERR! command sh -c sleep 100
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jonathan/.npm/_logs/2020-11-05T05_52_10_653Z-debug.log
Environment:
OS: Fedora 33
Node: 14.15.0
npm: 7.0.8
Reacted by Reece Pritchard, Hazri, Maxime Kubik, Zh4rsiest, Mustafa Talaeezadeh Khouzani, matievisthekat, Andrey Lushnikov, Joe Maller, Michał Drobniak and Antoine Bellion
Also getting this behaviour when I try to stop a webpack dev mode. It stops but prints out the same error message. Started happening when I upgraded to npm -v 7.0.7
Hm, yeah, we did recently update to send the signal to the child process, whereas before it would just end up sending the default SIGHUP that a child process gets when its parent exits.
Maybe what we ought to do is, if we're passing the signal along, then don't treat a signal exit as a failure, but just make sure that the main process dies with the same signal. (Ie, do proc.kill('SIGINT'), and when the child dies with a signal exit, do process.kill(process.pid, signal) ; setTimeout(() => {}, 500) so that the main process dies in the same way.)
Activity
rapritchard commentedon Nov 5, 2020
Also getting this behaviour when I try to stop a webpack dev mode. It stops but prints out the same error message. Started happening when I upgraded to npm -v 7.0.7
isaacs commentedon Nov 5, 2020
Hm, yeah, we did recently update to send the signal to the child process, whereas before it would just end up sending the default SIGHUP that a child process gets when its parent exits.
Maybe what we ought to do is, if we're passing the signal along, then don't treat a signal exit as a failure, but just make sure that the main process dies with the same signal. (Ie, do
proc.kill('SIGINT'), and when the child dies with a signal exit, doprocess.kill(process.pid, signal) ; setTimeout(() => {}, 500)so that the main process dies in the same way.)Proxy exit signals from foreground processes
@npmcli/run-script@1.7.5