方法1
1. 查看当前计算机的下载地址 npm get registry 2. 修改为淘宝npm镜像 npm config set registry http://registry.npm.taobao.org/ 3. 修改为cnpmjs镜像 npm config set registry http://r.cnpmjs.org/ 4. 修改为原始地址 npm config set registry http://registry.npmjs.org/
方法2
下载第三方插件,此方法不用更换下载命令还用原来的npm
全局配置
npm install nrm
-g
--save
查看当前下载地址
带 * 号的是当前下载路径
$ nrm ls
npm
---- https
://registry
.npmjs
.org
/
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
/
切换当前下载路径
下面是切换到 cnpm下载路径
nrm use cnpm