注册npm 下载地址为阿里云地址

更改源:

npm config set registry https://registry.npm.taobao.org --global

npm config set disturl https://npm.taobao.org/dist --global

查看本地镜像源

npm config get registry

 

也可以使用下面方式

npm install cnpm -g -registry=https://registry.npm.taobao.org