安装nrm
npm install -g nrm
查看npm镜像
nrm ls
可以看到有下列镜像
# npm官方镜像
npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
# cnpm镜像
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/
切换镜像
切换镜像只需要使用nrm use 镜像名称
就可以切换镜像
# 切换为淘宝镜像
nrm use taobao