#查看npm当前设置
npm config get registry
#设置新的淘宝源npm镜像
npm config set registry https://registry.npmmirror.com
#查看设置是否成功
npm config get registry
————————————————
yarn config get registry
yarn config set registry https://registry.npmmirror.com
yarn config get registry
如果有用nvm
1.找到nvm安装目录
nvm root
2.打开设置文件settings.txt
root: C:\nvm
path: C:\nodejs
# 配置node镜像:
node_mirror: https://npmmirror.com/mirrors/node/
# 配置npm镜像:
npm_mirror: https://npmmirror.com/mirrors/npm/