davestewart's avatar

Very slow installs and zillions of top-level folders after NPM update

I just updated to the latest Node using:

sudo npm install -g npm

Then running a project install takes about 5 minutes, and it now installs 778 top-level folders as opposed to the 5 modules I have in package.json.

Does anyone know what's going on!?

I hate it when this happens. You go to upgrade your setup to the latest and greatest, then the next thing you know, you're wasting the rest of the day working out what went wrong and not doing any actual work :(

0 likes
4 replies
JeffreyWay's avatar

They changed how they install dependencies. So you won't see top-level package folders anymore.

1 like
davestewart's avatar

Thanks Jeffery.

I thought this was the never-to-be-resolved issue that Windows users wanted solved, but the Node Gods refused to solve because of dependency conflicts?

I note that some top-level packages don't have node_modules folders, but some do. I presume this is the solution to that?

EDIT: I see here's some explanation: https://docs.npmjs.com/how-npm-works/npm3

EmilMoe's avatar

It should actually be faster now, but my connection here in the third world isn't too great so maybe it's just the amount downloaded that's faster not the data process

davestewart's avatar

There's this issue about the progress bar, which apparently can slow installs down by up to 10 times!

With progress bar:

npm install  1554.56s user 78.99s system 102% cpu 26:36.71 total
npm install  1549.49s user 77.94s system 102% cpu 26:24.81 total
Without progress bar:

npm install  146.21s user 58.80s system 123% cpu 2:45.79 total
npm install  142.22s user 53.92s system 122% cpu 2:39.68 total

20 minutes, 10x slower on the command line on OSx El Capitan!

https://github.com/npm/npm/issues/11283

I might try another install, just to see.

Please or to participate in this conversation.