Skip to content

Instantly share code, notes, and snippets.

@GavinJoyce
Last active November 20, 2020 04:01
Show Gist options
  • Save GavinJoyce/4f81d0bf879dad6b203e to your computer and use it in GitHub Desktop.
Save GavinJoyce/4f81d0bf879dad6b203e to your computer and use it in GitHub Desktop.
speeding up `npm install` by disabling the progress bar
with `react-native`:
npm set progress=false && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install
npm install 83.72s user 26.03s system 100% cpu 1:49.32 total
npm set progress=true && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install
npm install 199.30s user 27.32s system 91% cpu 4:08.29 total
--
npm set progress=false && rm -rf ~/.npm && rm -rf node_modules && time npm install
npm install 70.27s user 22.12s system 120% cpu 1:16.85 total
npm set progress=true && rm -rf ~/.npm && rm -rf node_modules && time npm install
npm install 202.59s user 26.47s system 105% cpu 3:36.52 total
@magalhas
Copy link

Can't achieve the same results. In fact I don't find any difference in my scenario. I'm using npm@3.5.3.

@SomeKittens
Copy link

Version 3.5.3, using package gustav, goes faster with progress bar (I also include system stats): https://gist.github.com/SomeKittens/aee7b945f413333fb049
(Update: no change [both ~1m] on work PC.)

Trying again with react-native, will update when I can

@SomeKittens
Copy link

Can replicate with react-native package, so it looks like this isn't universal.

Results

No bar: npm install 52.72s user 19.30s system 132% cpu 54.198 total
With progress bar: npm install 142.52s user 21.28s system 113% cpu 2:24.59 total

@Sequoia
Copy link

Sequoia commented Jan 26, 2016

npm --version
3.3.6
node --version
v5.0.0

npm set progress=false && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install
...
npm install  57.08s user 20.40s system 121% cpu 1:03.68 total

npm set progress=true && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install
...
npm install  118.09s user 22.18s system 115% cpu 2:01.77 total

Ha! Whoda thunk 😸

@jakerella
Copy link

npm: 2.14.7
node: 4.2.1

~/proj$ npm set progress=true && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install react-native
real 2m3.646s   user 1m18.821s   sys 0m8.877s

~/proj$ npm set progress=false && rm -rf ~/.npm && rm -rf node_modules && npm cache clean && time npm install react-native
real 1m54.747s   user 1m16.873s   sys 0m8.689s

@8eecf0d2
Copy link

node --version: 5.3.0
npm  --version: 3.3.12

Without real: 0m25.757s, user: 0m2.675s, sys: 0m0.513s
With real: 0m26.468s, user: 0m2.372s, sys: 0m0.465s

Maybe spacemonkey's do exist..

@renarsvilnis
Copy link

$ node -v
> 5.3.0
$ npm -v 
> 3.3.12

# with progress
npm install  110.43s user 15.62s system 33% cpu 6:13.81 total
# without progress
npm install  51.30s user 14.00s system 22% cpu 4:56.09 total

@soyuka
Copy link

soyuka commented Jan 28, 2016

(master ✓)❯ node -v
v5.3.0
(master ✓)❯ npm -v
3.3.12
# with progress
npm install  65.97s user 4.15s system 35% cpu 3:16.78 total
# without progress
npm install  41.70s user 3.77s system 25% cpu 2:56.22 total

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment