Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 461
Jeanluca Scaljeri Avatar asked Jun 15 '16 09:06

Jeanluca Scaljeri


3 Answers

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
like image 59
MrWillihog Avatar answered Oct 16 '22 09:10

MrWillihog


in the later version of npm you can use

npm install --no-progress

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

like image 25
ShoeLace Avatar answered Oct 16 '22 09:10

ShoeLace


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.

like image 6
Balmipour Avatar answered Oct 16 '22 07:10

Balmipour