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/
相关推荐
广州华水科技25 分钟前
单北斗GNSS形变监测一体机在基础设施安全中的应用与技术优势
前端
EndingCoder35 分钟前
案例研究:从 JavaScript 迁移到 TypeScript
开发语言·前端·javascript·性能优化·typescript
阿珊和她的猫2 小时前
React 路由:构建单页面应用的导航系统
前端·react.js·状态模式
Amumu121382 小时前
Vue脚手架(二)
前端·javascript·vue.js
花间相见2 小时前
【LangChain】—— Prompt、Model、Chain与多模型执行链
前端·langchain·prompt
lichenyang4533 小时前
从零开始构建 React 文档系统 - 完整实现指南
前端·javascript·react.js
比特森林探险记3 小时前
Hooks、状态管理
前端·javascript·react.js
landonVM3 小时前
Linux 上搭建 Web 服务器
linux·服务器·前端
css趣多多3 小时前
路由全局守卫
前端
AI视觉网奇4 小时前
huggingface-cli 安装笔记2026
前端·笔记