Npm install taking a lot of time to finish

npm install is taking about 20 minutes to finish, I thought something was wrong with my computer (I’m using OSX Yosemite) but then I tried at two different VPS servers running linux with the latest versions of node and npm and they took even longer than 20m to finish the install. I don’t think it is a lack of npm cache, since I tried it twice but didn’t make any difference. The node_modules directory size is also pretty big, at the end I got 250mb.

Is this time expected to be that long? Last time I used roots (I guess it was v7.0) it only took 1 or 2 minutes to finish.

20 mins seems like a long time, maybe something was up with the registry? imagemin and browsersync deps take a while to install, unfortunately.

just did a fresh install here:

npm install 131.03s user 39.92s system 125% cpu 2:16.11 total

On sunday the registry did take about double the time to respond. But that shouldn’t mean 20 minutes.

And yes the node_modules folder is about that big for me as well.

gulp-imagemin and imagemin make up a lot of that. They also make up a lot of the npm install time because they need to be compiled from source in some cases. I am very torn about removing them because out of all the things we do to increase performance (concat, uglify, minify, etc.) lossless image compression provides the bulk of the performance benefit. You can spend all day reducing javascript dependencies and thinning out your CSS: but reducing just one large jpg by 20% will pretty much have the same impact.

1 Like