npm 源切换国内镜像

422 阅读1分钟

1、查看npm镜像源

npm config get registry

2、设置国内镜像

npm config set registry=https://registry.npmmirror.com

3、cnpm使用淘宝镜像

npm install -g cnpm --registry=https://registry.npm.taobao.org
//永久使用
npm config set registry https://registry.npm.taobao.org