npm切换淘宝镜像的两种方法

第一种 :全局切换镜像(链接切换)

1
npm config set registry http://registry.npm.taobao.org/

查看镜像使用状态

1
npm get registry

全局切换回官方源

1
npm config set registry http://www.npmjs.org

第二种(nrm切换):利用npm 下载nrm

1
npm install -g nrm

查看可切换的镜像源

1
nrm ls

切换镜像源(如淘宝)

1
nrm use taobao