Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Any script which writes to standard output but does not emit a \n as its final character will have output erased when npm run exits.
Expected Behavior
npm run should never interfere with the output of scripts.
Steps To Reproduce
- Create a
package.json file like this:
{
"name": "",
"version": "0.0.0",
"scripts": {
"start": "printf 'this output will vanish'; sleep 3"
}
}
- Run
npm run start.
- Observe that the output vanishes after three seconds.
Environment
npm -v: 11.6.0
node -v: v22.18.0
- OS Name: macOS 15.6
- System Model Name: MacBook Pro
- npm config:
//localhost:4873/:_authToken = (protected)
//registry.npmjs.org/:_authToken = (protected)
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Any script which writes to standard output but does not emit a
\nas its final character will have output erased whennpm runexits.Expected Behavior
npm runshould never interfere with the output of scripts.Steps To Reproduce
package.jsonfile like this:{ "name": "", "version": "0.0.0", "scripts": { "start": "printf 'this output will vanish'; sleep 3" } }npm run start.Environment
npm -v: 11.6.0node -v: v22.18.0