一、查看现在的镜像源
通常默认官方源是https://registry.npmjs.org
npm
npm config get registry
二、切换镜像源
npm
//切换淘宝源
npm config set registry https://registry.npm.taobao.org
//切换腾讯源
npm config set registry http://mirrors.cloud.tencent.com/npm/
//切换阿里云源
npm config set registry https://registry.npmmirror.com