Everything I do with NPM takes several minutes; especially npm install
, even if I already have all the packages installed. I first thought the problem is that the old code I am working with just takes longer to update (because last time an older npm version was used) but the problem percists even if I repeat the process.
My system and other Information:
What I tried so far with no luck:
http
instead of https
a la:npm config set registry http://registry.npmjs.org/ --global
as was suggested in 'npm install' extremely slow on Windows.
It seems to me it still tries to connect to the https
address (at least that's what it looks like if I use npm install --verbose
to show more feedback).
No matter what I still sit here, wasting ages waiting for my npm install.
I finaly found a solution. I just did not now to ask the right question.
The problem was that I was using WSL version 2 and my files are in C: and not the Ubuntu folders. A fix that worked for me was moving to WSL version 1.
More details can be found here.
If you're also switching to WSL version 1 and are having problems with node or npm, this might help.