Ask HN: How to speed up NPM installs?
I work at a company in a backend role, but our front-end team routinely requires NPM clean / installs which take more than 10 minutes each. We're looking for a solution.
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 (?).
Is this truly the state of affairs in NPM? Surely there is a way to update repositories without deleting every dependency every time.
5 comments
[ 67.8 ms ] story [ 181 ms ] threadIt's quick and dirty, but it could work.
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?
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/