淘宝镜像源
https://registry.npmmirror.com/
腾讯云镜像源
https://mirrors.cloud.tencent.com/npm/
cnpm是一个基于npm的中国镜像源
https://r.cnpmjs.org/
# 查询当前使用的镜像源
npm get registry
# 设置为淘宝镜像源
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.npmmirror.com/
# 还原为官方镜像源
yarn config set registry https://registry.yarnpkg.com/
pnpm设置国内镜像源
# 查询当前使用的镜像源
pnpm get registry
# 设置为淘宝镜像源
pnpm config set registry https://registry.npmmirror.com/
# 还原为官方镜像源
pnpm config set registry https://registry.npmjs.org/