Created
December 4, 2023 18:45
-
-
Save benweint/fb6ee6813347e1211d6d809ba33efedc to your computer and use it in GitHub Desktop.
pnpm signal handling issue repro case
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "pnpm-signals", | |
"private": true, | |
"version": "1.0.0", | |
"description": "", | |
"scripts": { | |
"dev": "node signals.js" | |
}, | |
"author": "", | |
"license": "ISC" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
process.once('SIGINT', () => { | |
console.log('caught SIGINT, will exit in 1s'); | |
setTimeout(() => { | |
console.log('exiting after 1s') | |
process.exit(0); | |
}, 1_000); | |
}); | |
setInterval(() => { | |
console.log('waiting ...'); | |
}, 1_000); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## with pnpm | |
❯ pnpm --version | |
8.11.0 | |
❯ pnpm run dev | |
> [email protected] dev /Users/ben/Desktop/pnpm-signals | |
> node signals.js | |
waiting ... | |
^Ccaught SIGINT, will exit in 1s | |
# note that the 'exiting after 1s' message is never seen! | |
## with npm | |
❯ npm --version | |
9.7.2 | |
❯ npm run dev | |
> [email protected] dev | |
> node signals.js | |
waiting ... | |
^Cwaiting ... | |
caught SIGINT, will exit in 1s | |
waiting ... | |
exiting after 1s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment