
Ask HN: How to speed up NPM installs? - alexandercrohde
I work at a company in a backend role, but our front-end team routinely requires NPM clean &#x2F; installs which take more than 10 minutes each. We&#x27;re looking for a solution.<p>It seems the reason they clean out all of their packages, is because one dependency is another internal project and that for some reason it gets cached unless an NPM clean is run (?).<p>Is this truly the state of affairs in NPM? Surely there is a way to update repositories without deleting every dependency every time.
======
fiiv
You could always make a preinstall script that deletes the folder for that one
dependency, then run install.

It's quick and dirty, but it could work.

------
davman
Lots of possibilities. What npm version are we talking about?

~~~
alexandercrohde
We're on node 6.9, NPM 3.10

The FE guy seems to think that upgrading Npm wouldn't fix it, because "Some
kind of caching mechanism kicks in, and the only way to really resolve it is
by nuking everything and starting from scratch. This is because we use git
tags (github release tags)."

Does that make sense?

~~~
davman
npm caching has been heavily reworked between 3x and 5x and may well end up
resolving the problem they are having in the first place.

Suggest they give this a try as a first port of call. After that it's worth
figuring out if the dependency tree is purely massive and you're fetching
thousands of packages per install, or if its the NPM service responding
slowly, in which case a local proxy in your business may well help here; I'd
recommend [https://www.verdaccio.org/](https://www.verdaccio.org/)

------
thepapanoob
simply upgrade your node & npm or switch to yarn

