查看 npm 的下载源:npm config get registry
将 npm 的下载源设置为淘宝镜像源:npm config set registry https://registry.npm.taobao.org
yarn 换源的命令与 npm 相同。
查看 yarn 的下载源:yarn config get registry
将 yarn 的下载源设置为淘宝镜像源:yarn config set registry https://registry.npm.taobao.org
原文:https://www.cnblogs.com/yiheyue/p/10739265.html