-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] trap 'exit 0' SIGINT doesn't work in npm scripts #1947
Comments
This is interesting.. I'll do a little research and see if I can figure out what might've broken this.
Leaving the suggestion, but after some manual testing the proposed workaround does not work. I'll keep looking! |
@nlf any update on this? I'm still having this issue in v7.0.3 (it's preventing me from using npm v7 regularly). Thanks. |
i've identified the issue and am working on a fix, hopefully we'll have something for you soon! |
hi @rafgraph! we published 7.0.6 of npm today that should resolve this for you, can you update with |
Yup, works great, thanks @nlf |
Current Behavior:
trap 'exit 0' SIGINT
in an npm script doesn't seem work. I use this to preform clean up after exiting runningwatch
scripts withctrl c
(maybe there's a better way to do this?).In npm v6,
npm run dev
links the package to globalnode_modules
, then runs the watch script which watches for changes and re-compiles, when I'm done Ictrl c
, the watch script stops andnpm unlink ...
is run to preform cleanup.In npm v7, after I
ctrl c
, that's it, nothing runs. I ran it with--loglevel silly
but nothing is printed to the terminal after Ictrl c
.Expected Behavior:
For the
watch
script to exit with 0 after I pressctrl c
andnpm unlink ...
to run.Steps To Reproduce:
You can reproduce it using my
react-router-hash-link
repo (the dev setup is pretty simple).Environment:
The text was updated successfully, but these errors were encountered: