FacebookLinkedInShare

Hi,

As a nodejs software developers we are often doing npm install command (to install dependencies on a nodejs app).

This command can take more than 1 minute depend on your node dependencies size. So it can be a real time waste and also annoying to wait for it to finish.

I read a nice article that explains the reason for the slowness I would like to share, You can read it on the issue here.

This is what you need to do in order to boost npm install command:

npm set progress=false
npm i

The command:
npm set progress=false, will remove progress bar from install command and will give you the time boost needed!!

You can even get extra time saver by deleting only npm modules you want to install and not remove all of them. For example, our company internal node packages always start with: “ni-“, so on my MAC I’v created a nice alias that remove only ni packages, this is how the alias look (You can add to your .zshrc file for example):

alias niupdate='npm cache clean && rm -rf node_modules/ni-* && echo "deleted internal packages" && npm set progress=false && npm i'

Now by simple navigate to any node directory you can type: niupdate and that’s all.

Hope I save you some time, happy coding…