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/
相关推荐
whoarethenext31 分钟前
linux的信号量初识
linux·运维·前端·c/c++·信号量
贰元12 小时前
微信聊天机器人搭建 教程/开发
运维·服务器·前端
wuhen_n3 小时前
CSS元素动画篇:基于当前位置的变换动画(合集篇)
前端·css·html·css3·html5
专注VB编程开发20年4 小时前
JS检测htm哪个子节点的内容被修改addEventListener(‘input‘, (event)
前端·html5·js
凉生阿新4 小时前
【React】Hooks useReducer 详解,让状态管理更可预测、更高效
前端·react.js·前端框架
a181001_4 小时前
自制简易html指南针
前端·html·html5
BillKu5 小时前
Vue3取消网络请求的方法(AbortController)
前端·javascript·vue.js
海天胜景6 小时前
c# list<T> 合并
前端·c#
陈奕昆7 小时前
【LLaMA-Factory实战】Web UI快速上手:可视化大模型微调全流程
前端·ui·llama·大模型微调实战