当我们使用npm安装依赖时,下载很慢,需要使用淘宝镜像,增加下载速度
1.查看镜像
npm config get registry
// 如果显示https://registry.npmjs.org表示默认镜像
2.设置镜像
// 永久设置
npm config set registry https://registry.npmmirror.com
// 单次使用
npm install --registry=http://registry.npmmirror.com
3.如果还想用官方的镜像
npm config set registry https://registry.npmjs.org