简体   繁体   中英

How to disable npm's progress bar

As pointed out here the progress bar of npm slows down the whole installation progress significantly. The solution given is to disable it

$> npm set progress=false && npm install

The question I have, is it possible inside a project to set something (in package.json for example) such that I can omit progress=false on the command line and simply can do $> npm install and obtain the same result as above?

Add the following to a file called .npmrc in your project root folder:

progress=false

It is also possible to place this file in your home directory: ~/.npmrc

Learn more about NPM config.

You can also do this on the command line:

npm install --no-progress

in the later version of npm you can use

npm install --no-progress

see https://docs.npmjs.com/misc/config#progress

While the op's and selected answer probably work well, my issue was different : some build steps in package.json explicitely included --progress , which was just making my Jenkins builds slow and ugly.

I removed those with a simple sed before executing npm install :
sed -i 's#--progress##g' package.json

Of course, if I had had write access to , it might have been better to remove the --progress argument directly from the sources files.


Anyway, I hope it will help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM