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
Killing the process with CTRL-C or sending SIGINT won't immediately kill npm. If I hit CTRL-C while the install progress bar is visible npm will continue running till the progress bar is full, including starting new http requests. Eventually npm will print
npm ERR! process terminated
npm ERR! signal SIGINT
Some excerpts from a silly log shows that npm runs for 12 seconds after the signal.
Dec 17 16:34:23 npm timing reifyNode:node_modules/esbuild-android-64 Completed in 48ms
Dec 17 16:34:23 SIGINT
Dec 17 16:34:24 npm http fetch POST 405 http://localhost:8080/-/npm/v1/security/advisories/bulk 305ms
...
Dec 17 16:34:24 npm http fetch GET 200 http://localhost:8080/rimraf 367ms (cache updated)
Dec 17 16:34:36 npm http fetch GET 200 http://localhost:8080/ansi-styles/-/ansi-styles-4.3.0.tgz 5860ms (cache updated)
Dec 17 16:34:36 npm timing reifyNode:node_modules/asse.rtion-error Completed in 12320ms
...
Dec 17 16:34:36 npm timing reify:unpack Completed in 12387ms
Dec 17 16:34:36 npm timing reify:rollback:createSparse Completed in 174ms
Dec 17 16:34:36 npm timing reify:rollback:retireShallow Completed in 11ms
Dec 17 16:34:36 npm timing command:install Completed in 12796ms
Dec 17 16:34:36 npm verb stack Error: process terminated
A second SIGINT signal will cause an immediate exit
Expected Behavior
Npm should exit soon after receiving SIGINT. If npm has to clean up after itself it should print a message - but it doesn't seem like it's cleaning up, instead it's continuing to fetch packages.
Steps To Reproduce
On an Ubuntu linux computer with npm 9.2.0 or 8.19.2
In a package with enough dependencies for npm install to take a while
With a package-lock.json
Without node_modules
Run npm install
Hit ctrl-c when you see the progress bar
See the progress bar continue and wait for npm to exit.
Interestingly it doesn't seem to reproduce without a package-lock.json.
Environment
npm: 9.2.0 (and 8.19.2)
Node.js: 18.12.1
OS Name: Ubuntu
System Model Name:
npm config:
; node version = v18.12.1
; npm local prefix = ~/example
; npm version = 8.19.2
; cwd = ~/example
; HOME = ~
; Run `npm config ls -l` to show all defaults.
The text was updated successfully, but these errors were encountered:
An interesting wrinkle is that npm will hang forever if it gets SIGINT and the registry server stops completing requests
This script starts a npm registry proxy and npm install process. ctrl-c sends SIGINT to both processes, killing the server but the install process never exits, it hangs with a broken progress bar. I assume npm would eventually exit after some timeout or the socket hangs up.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Reproducible in npm 9.2.0 and 8.19.2
Killing the process with CTRL-C or sending SIGINT won't immediately kill npm. If I hit CTRL-C while the install progress bar is visible npm will continue running till the progress bar is full, including starting new http requests. Eventually npm will print
Some excerpts from a silly log shows that npm runs for 12 seconds after the signal.
A second SIGINT signal will cause an immediate exit
Expected Behavior
Npm should exit soon after receiving SIGINT. If npm has to clean up after itself it should print a message - but it doesn't seem like it's cleaning up, instead it's continuing to fetch packages.
Steps To Reproduce
npm install
to take a whilenode_modules
npm install
ctrl-c
when you see the progress barSee the progress bar continue and wait for npm to exit.
Interestingly it doesn't seem to reproduce without a package-lock.json.
Environment
The text was updated successfully, but these errors were encountered: