NPM
// 查看当前地址
npm config get registry
// 设置淘宝镜像
npm config set registry https://registry.npm.taobao.org
YARN
// 查看当前地址
yarn config get registry
# -> https://registry.yarnpkg.com
// 设置淘宝镜像
yarn config set registry https://registry.npm.taobao.org
# -> yarn config v1.9.4
# -> success Set "registry" to "https://registry.npm.taobao.org".
# -> Done in 0.06s.
***一定注意源地址不能带引号