npm和yarn设置镜像源

npm

设置为淘宝源
npm config set registry https://registry.npm.taobao.org

使用nrm管理

nrm: npm registry manage

nrm ls

yarn

查看源
yarn config get registry
设置为淘宝源
yarn config set registry https://registry.npm.taobao.org
设置为默认
yarn config set registry https://registry.yarnpkg.com

原文地址:https://www.cnblogs.com/shengulong/p/12005224.html