npm pnpm yarn 设置国内镜像

国内镜像

常用的国内镜像:

淘宝镜像 https://registry.npmmirror.com

腾讯云镜像​​ https://mirrors.cloud.tencent.com/npm/

华为云镜像​​ https://repo.huaweicloud.com/repository/npm/

CNPM(阿里系) ​​ https://r.cnpmjs.org/

清华大学镜像​​ https://mirrors.tuna.tsinghua.edu.cn/help/npm/

npm

bash 复制代码
# 查询当前使用的镜像源
npm get registry

# 设置为淘宝镜像源
npm config set registry https://registry.npmmirror.com/

# 还原为官方镜像源
npm config set registry https://registry.npmjs.org/

pnpm

bash 复制代码
# 查询当前使用的镜像源
pnpm get registry

# 设置为淘宝镜像源
pnpm config set registry https://registry.npmmirror.com/

# 还原为官方镜像源
pnpm config set registry https://registry.npmjs.org/

yarn

bash 复制代码
# 查询当前使用的镜像源
yarn config get registry

# 设置为淘宝镜像源
yarn config set registry https://registry.npmmirror.com/

# 还原为官方镜像源
yarn config set registry https://registry.yarnpkg.com/

临时指定镜像

bash 复制代码
npm --registry https://registry.npmjs.org/ install <package-name>
pnpm --registry https://registry.npmjs.org/ add <package-name>
yarn add <package-name> --registry=https://registry.yarnpkg.com/
相关推荐
小桥风满袖12 分钟前
极简三分钟ES6 - const声明
前端·javascript
小小前端记录日常14 分钟前
vue3 excelExport 导出封装
前端
南北是北北16 分钟前
Flow 的 emit 与 tryEmit :它们出现在哪些类型、背压/缓存语义、何时用谁、常见坑
前端·面试
flyliu19 分钟前
继承,继承,继承,哪里有家产可以继承
前端·javascript
司宸20 分钟前
Cursor 编辑器高效使用与配置全指南
前端
维维酱21 分钟前
为什么说 useCallback 实际上是 useMemo 的特例
前端·react.js
王六岁21 分钟前
Vue 3 表单验证组合式 API,提供类似 Ant Design Vue Form 的强大表单验证功能
前端·vue.js
机构师21 分钟前
<uniapp><日期组件>基于uniapp,编写一个自定义的日期组件
前端·javascript
lypzcgf25 分钟前
Coze源码分析-资源库-创建提示词-前端源码
前端·人工智能·typescript·系统架构·开源软件·react·安全架构
fury_12328 分钟前
vue3:el-date-picker三十天改成第二十九天的23:59:59
前端·javascript·vue.js