npm和yarn更换国内淘宝镜像
npm 配置
查询当前配置的仓库地址
npm get registry
设置为淘宝镜像
// 设置为淘宝镜像
npm config set registry https://registry.npm.taobao.org/ (旧地址)
npm config set registry https://registry.npmmirror.com/ (最新地址)
重置为官方镜像
npm config set registry https://registry.npmjs.org/
yarn 配置
查询当前配置的仓库地址
yarn config get registry
设置为淘宝镜像
yarn config set registry https://registry.npm.taobao.org/ (旧地址)
yarn config set registry https://registry.npmmirror.com/ (最新地址)
重置为官方镜像
yarn config set registry https://registry.yarnpkg.com