-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement: cli should distinguish between stdout and stderr #4724
Comments
I have a few thoughts on this:
|
From the RFC meeting on 2/23 the next steps are to implement the following:
|
…ng for next version: npm/cli#4724
I would also suggest removing the constant "shouting" of Only the lines that actually state some errors should contain text towards that. The original issue reference is a good example of this. It should be enough to highlight the single line This helps support side find the actual lines that matter a lot faster and the logs become.. well "less alarming" 😉 |
I'm going to close this since since a lot of progress was made in standardizing and separating what goes on stderr vs stdout. There is still some work left to do, but followup items will be tracked in npm/statusboard#829 |
Motivation ("The Why")
Whenever npm prints error, it uses stdout. This is wrong. stdout should be used for standard output, for a regular run of the program.
The error should always be printed via stderr, and there many benefits of that, to name a few:
Example
whenever npm install doesn't find a package, npm should print to stderr.
How
using the standard error stream
Current Behaviour
prints red ERR in stdout.
the stderr remains empty through out the run of the program even if the command fails
Desired Behaviour
The error message will be printed to stderr.
References
For example the following message will be printed in stderr and not in stdout:
npm ERR! [email protected] install:
node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the node-gd package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs node-gd
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls node-gd
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /root/lospec/npm-debug.log
The text was updated successfully, but these errors were encountered: