// 打开终端
npm install -g cnpm --registry=https://registry.npm.taobao.org
// 更换镜像源
npm config set registry https://registry.npm.taobao.org
// 验证是否成功
npm config get registry
解决部分前端工具无法下载的问题。
注意事项
1.更换镜像源后
vsCode登录会出现
“npm login error 500”报错
解决办法:
// 更换回原来的镜像源
npm config set registry https://registry.npmjs.org/