You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a script that writes to stdout using fs.write or its relatives via npx or npm exec, the terminal prompt overwrites any output after the last newline (or all output, if no newline was written). See DanielXMoore/Civet#1424 for the discussion and troubleshooting that led to us realizing this is npm's fault.
Expected Behavior
The terminal prompt should be written after the text, not over top of it
Use npx or npm exec to cause this script to be executed
Notice that the prompt is written over top of the "a", causing the output to be deleted.
Environment
npm: 10.9.0
Node.js: 20.18.0
OS Name: Ubuntu 22.04 running in WSL 2 on Windows 11
npm config:
; "user" config from /home/bbrk24/.npmrc
//registry.npmjs.org/:_authToken = (protected)
; node bin location = /home/bbrk24/.nvm/versions/node/v20.18.0/bin/node; node version = v20.18.0; npm local prefix = /home/bbrk24/workspace/template-qdeql; npm version = 10.9.0; cwd = /home/bbrk24/workspace/template-qdeql; HOME = /home/bbrk24; Run `npm config ls -l` to show all defaults.
The text was updated successfully, but these errors were encountered:
It's not safe to assume npm won't log or disrupt the expectations of stdout and stderr for any given script. If you need finely tuned output -s is the best bet at ensuring that your script will write to stdout / stderr correctly. Ideally you wouldn't need to add -s in some of these cases, but given that people can have custom log levels, you'd need to use -s to overwrite individual configs anyway.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When running a script that writes to stdout using
fs.write
or its relatives vianpx
ornpm exec
, the terminal prompt overwrites any output after the last newline (or all output, if no newline was written). See DanielXMoore/Civet#1424 for the discussion and troubleshooting that led to us realizing this is npm's fault.Expected Behavior
The terminal prompt should be written after the text, not over top of it
Steps To Reproduce
npx
ornpm exec
to cause this script to be executedEnvironment
The text was updated successfully, but these errors were encountered: