NPM修改镜像源为淘宝镜像

默认的npm镜像地址在国外,有时网络波动,导致依赖无法加载

临时引用

npm install --registry=https://registry.npmmirror.com/

全局修改

npm config set registry https://registry.npmmirror.com/
npm config set disturl https://npmmirror.com/dist
yarn config set registry https://registry.npmmirror.com/
yarn config set disturl https://npmmirror.com/dist

验证
npm config get registry

删除

npm config delete registrynpm config delete disturl