"npm install" is extremely slow on Windows

For me, npm install very slow. I am using Windows 8.1 with the latest version of npm. My connection speed is about 100 Mbps.

The project I'm trying to install contains about 20 packages / dependencies, and it takes about 30 minutes to install all the dependencies ...

Does anyone have a clue?

+44
windows npm
Apr 01 '15 at 15:45
source share
7 answers

I ran into the same problem using --verbose , as the aforementioned peterh showed me the source of the problem: I am for a proxy that uses its own certificates for https connections. According to the user "Mletter1" at https://github.com/npm/npm/issues/8872 , the problem is pretty easy to solve with http:

 npm config set registry http://registry.npmjs.org/ --global 

And voila, it's fast. Of course, you should only do this if everything is okay with information about the open npm file over the network; -)

+8
Nov 21 '16 at 13:48
source share
— -

I ran into the same problem for a while. I tried the following

 npm i typescript live-server --save-dev 

Installation will be stuck on it forever. However, adding the -verbose flag worked just fine.

+6
Oct 28 '15 at 15:29
source share

It seems that npm cannot handle the internet connection and can sometimes end in such a situation.

1) . I advise you to check if your firewall or antivirus, scanning or filtering is working, which may slow down the installation of npm.

2) You can also use npm caching as shown below.

 npm install package-name --cache "c:\path\to\use\as\dependencies\cache" 

this will allow the use of npm and cache dependencies in the directory you specify.

3) another solution for caching dependencies of npm npm lazy packages, you can find more information about this on the npm Lazy website

Note. The caching process may or may not increase download speed, but it will probably save loading time when installing or updating npm packages.

+3
Apr 18 '15 at 17:15
source share

I know it is just a workaround , but try using the built-in " Windows PowerShell "

+3
Apr 12 '17 at 18:09 on
source share

For me, this turned out to be a problem with IPv6.

Disabling IPv6 helped me a lot.
With IPv6 enabled, “update-package newtonsoft.json” took 1:45 to disconnect with the “update-package: task was canceled” service pack.

With IPv6 disabled, "update-package newtonsoft.json" completed in 10 seconds

+2
Nov 17 '15 at 15:53
source share

Disabling Windows Firewall and Windows Defender Real-time protection did this for me in Windows 10.

0
Feb 25 '17 at 15:51
source share

I encountered the same problem when creating a project when using angular cli "ng new PROJECT_NAME", this command starts "npm -install" after creating a project that took too long to install and is stuck in "Installing packages for using npm" . Follow the ones that worked for me

1) Check the npm version of "npm --version" (should be higher than 2.1.8). Update your npm package "npm -g install --save last-version"

2) Remove the progress bar, which consumes more time "npm set progress = false"

check these issues if the problem persists https://github.com/nodejs/node/issues/4150 https://github.com/npm/npm/issues/11283

Hope this will be a Cheers problem!

0
Apr 17 '17 at 14:09 on
source share



All Articles