cli icon indicating copy to clipboard operation
cli copied to clipboard

[QUESTION] <npm install takes so long on windows>

Open hugopedro opened this issue 6 years ago • 10 comments

What / Why

When I type "npm install" it takes ~5-10 minutes on windows, on linux is 1 minute

These lines caught my attention:

npm timing action:extract Completed in 234805ms npm timing action:finalize Completed in 21198ms npm timing action:refresh-package-json Completed in 128891ms npm verb unlock done using C:\Users\Hugo\AppData\Roaming\npm-cache_locks\staging-2acf162e836ea64f.lock for C:...\node_modules.staging npm timing stage:executeActions Completed in 395181ms npm info lifecycle [email protected]~prepare: [email protected] npm timing stage:runTopLevelLifecycles Completed in 399677ms npm verb saving []

So, what can I do to fix this very slow performance when 'npm install'?

hugopedro avatar Aug 01 '20 00:08 hugopedro

bump

hugopedro avatar Aug 10 '20 13:08 hugopedro

We were experiencing a similar issue; it turned out to be the result of our antivirus policy. There is a folder which on a linux machine is normally ~/.npm/_lock which our AV needed to ignore.

pburkindine avatar Dec 08 '20 14:12 pburkindine

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.

darcyclarke avatar Jun 02 '21 21:06 darcyclarke

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.

darcyclarke avatar Jun 02 '21 21:06 darcyclarke

@hugopedro Did you ever find out what was causing this issue?

conallprendergast avatar Jun 15 '22 12:06 conallprendergast

@hugopedro we are experiencing the same issue here, we are using Centos7 and it take 40 min only in "npm timing action:extract Completed in 2474343ms"

Capture d’écran, le 2023-07-18 à 09 41 14

diegodelico avatar Jul 18 '23 13:07 diegodelico

@diegodelico for me this problem was caused by a particular dependency in my package.json, that was attempting to pull from GitHub using the git protocol. This was disabled by GitHub, see https://blog.readthedocs.com/github-git-protocol-deprecation/

Have a look at results from "--loglevel silly" and see if there are any timeouts

conallprendergast avatar Jul 18 '23 14:07 conallprendergast

@conallprendergast thank you so much!! I found the problem Capture d’écran, le 2023-07-18 à 11 45 41 I just need to find a solution now, but thanks again!

diegodelico avatar Jul 18 '23 15:07 diegodelico

@diegodelico glad to help. Solution should be to use the "git+https://" protocol instead in your package.json

conallprendergast avatar Jul 18 '23 16:07 conallprendergast

@conallprendergast it works!, thanks again! 💪

diegodelico avatar Jul 18 '23 17:07 diegodelico