Open
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
Current Behavior
Interrupting tests with ctrl-c results in an error:
TypeError: The "code" argument must be of type number. Received type string ('128SIGINT')
at process.set [as exitCode] (node:internal/bootstrap/node:123:9)
at ChildProcess. (/Users/dan/Source/npm-cli/node_modules/nyc/node_modules/foreground-child/index.js:63:22)
at ChildProcess.emit (node:events:514:28)
at ChildProcess.emit (node:domain:489:12)
at maybeClose (node:internal/child_process:1105:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:305:5)
This seems to come from bad logic adding a number to a string in [email protected]
(outdated) via [email protected]
(latest, but unmaintained).
Expected Behavior
Tests should exit cleanly.
Steps To Reproduce
- In Mac or Windows
- Run
npm test
- Use ctrl-c to abort the tests
- Observe error
Environment
- npm: 10.0.0
- Node.js: 20.6.0
- OS Name: macOS
- System Model Name: Macbook Air
- npm config:
; "builtin" config from /opt/homebrew/lib/node_modules/npm/npmrc
prefix = "/opt/homebrew"
; "user" config from /Users/dan/.npmrc
auto-install-peers = true
; "project" config from /Users/dan/Source/npm-cli/.npmrc
package-lock = true
; node bin location = /opt/homebrew/Cellar/node/20.6.0/bin/node
; node version = v20.6.0
; npm local prefix = /Users/dan/Source/npm-cli
; npm version = 9.8.1
; cwd = /Users/dan/Source/npm-cli
; HOME = /Users/dan
; Run `npm config ls -l` to show all defaults.