2024最新国内镜像源设置(npm、yarn、pnpm)

淘宝镜像源
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/
相关推荐
二进制星轨7 分钟前
在 Ubuntu 上快速配置 Node.js 环境(附问题说明)
linux·ubuntu·node.js
季春二九11 分钟前
Edge 卸载工具 | 版本号1.0 | 专为彻底卸载Microsoft Edge设计
前端·microsoft·edge·edge 卸载工具
雨过天晴而后无语12 分钟前
HTML中JS监听输入框值的即时变化
前端·javascript·html
座山雕~14 分钟前
html 和css基础常用的标签和样式(2)-css
前端·css·html
一勺菠萝丶18 分钟前
为什么 HTTP 能访问,但 HTTPS 却打不开?——Nginx SSL 端口配置详解
前端
黄毛火烧雪下23 分钟前
Node.js 自动替换脚本工具:一键完成多项目批量修改与资源替换
node.js·ci
4Forsee27 分钟前
【Android】消息机制
android·java·前端
不爱说话郭德纲27 分钟前
UniappX不会运行到鸿蒙?超超超保姆级鸿蒙开发生成证书以及配置证书步骤
前端·uni-app·harmonyos
Olafur_zbj30 分钟前
【IC】NoC设计入门 -- 网络接口NI Slave
前端·javascript·php
IT_陈寒34 分钟前
React性能优化:10个90%开发者不知道的useEffect正确使用姿势
前端·人工智能·后端