共计 611 个字符,预计需要花费 2 分钟才能阅读完成。
淘宝镜像源
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/
原文地址: 2024 最新国内镜像源设置(npm、yarn、pnpm)
正文完