Skip to content
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

Silence npm logs when builds fail #133

Closed
humphd opened this issue Nov 10, 2019 · 3 comments · Fixed by #138
Closed

Silence npm logs when builds fail #133

humphd opened this issue Nov 10, 2019 · 3 comments · Fixed by #138
Assignees
Labels
Projects

Comments

@humphd
Copy link
Contributor

@humphd humphd commented Nov 10, 2019

When tests fail, we spit out a bunch of useless npm error logs that have nothing to do with the actual problem, for example:

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! telescope@0.0.1 stylelint: `stylelint --ignore-path .gitignore .`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the telescope@0.0.1 stylelint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2019-11-10T04_08_59_327Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! telescope@0.0.1 postlint: `npm run stylelint`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the telescope@0.0.1 postlint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR!     /home/travis/.npm/_logs/2019-11-10T04_08_59_342Z-debug.log
npm ERR! Test failed.  See above for more details.
The command "npm test" exited with 1.

We can suppress this noise by adding an .npmrc file to our project root that contains the following line:

loglevel=silent
@humphd humphd added the area: CI/CD label Nov 10, 2019
@zufishanali

This comment has been minimized.

Copy link
Collaborator

@zufishanali zufishanali commented Nov 10, 2019

Hi @humphd, may I look into this?

@humphd

This comment has been minimized.

Copy link
Contributor Author

@humphd humphd commented Nov 10, 2019

Go ahead @zufishanali. This will be a 1 line fix, so you probably want to pair this with another issue for your release.

@Reza-Rajabi Reza-Rajabi added this to Issue in Main via automation Nov 11, 2019
@Reza-Rajabi Reza-Rajabi moved this from Issue to In progress/Review in Main Nov 11, 2019
@zufishanali

This comment has been minimized.

Copy link
Collaborator

@zufishanali zufishanali commented Nov 11, 2019

Thanks @humphd. Yes, for sure!

@humphd humphd closed this in #138 Nov 11, 2019
Main automation moved this from In progress/Review to Closed Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Main
Closed
3 participants
You can’t perform that action at this time.