'npm install' extremely slow on Windows

后端 未结 13 1830
面向向阳花
面向向阳花 2020-12-24 04:35

For me is npm install extremely slow. I\'m using Windows 8.1 with the latest npm version. My connection speed is around 100Mbit/s.

The project I\'m tryi

13条回答
  •  情歌与酒
    2020-12-24 04:46

    Make sure you really are using a recent version of npm. In my case C:\Program Files\nodejs\npm.cmd had been using an old npm-cli.js below the default prefix folder %appdata%\npm rather than a newer npm-cli.js below C:\Program Files\nodejs.

    Setting the environment variable npm_config_prefix to C:\Program Files\nodejs solved that. (Before finding that solution, I tried using the --prefix argument and found out the hard way doing so "forces non-global commands to run in the specified folder".)

    I found a huge performance increase going from 3.10.9 to 6.13.4-- enough to make npm install times acceptable despite interference from antivirus.

提交回复
热议问题