Skip to content

Instantly share code, notes, and snippets.

@benweint
Created December 4, 2023 18:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benweint/fb6ee6813347e1211d6d809ba33efedc to your computer and use it in GitHub Desktop.
Save benweint/fb6ee6813347e1211d6d809ba33efedc to your computer and use it in GitHub Desktop.
pnpm signal handling issue repro case
{
"name": "pnpm-signals",
"private": true,
"version": "1.0.0",
"description": "",
"scripts": {
"dev": "node signals.js"
},
"author": "",
"license": "ISC"
}
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);
## with pnpm
❯ pnpm --version
8.11.0
❯ pnpm run dev
> pnpm-signals@1.0.0 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
> pnpm-signals@1.0.0 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