由于国内网络原因,使用npm官方镜像速度感人,可以通过切换镜像为国内源来进行加速。
1.查看当前镜像
PS E:\japp> npm config get registry
https://registry.npmjs.org/
2.安装nrm
PS E:\japp> npm install -g nrm
3.查看可用镜像源
PS E:\japp> nrm ls
* npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
cnpm ------- http://r.cnpmjs.org/
taobao ----- https://registry.npm.taobao.org/
nj --------- https://registry.nodejitsu.com/
npmMirror -- https://skimdb.npmjs.com/registry/
edunpm ----- http://registry.enpmjs.org/
4.切换为taobao
PS E:\japp> nrm use taobao
Registry has been set to: https://registry.npm.taobao.org/
PS E:\japp> npm config get registry
https://registry.npm.taobao.org/