npm、pnpm、yarn使用淘宝镜像

文章目录

npm

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

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

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

pnpm

安装方法

Windows

powershell 复制代码
iwr https://get.pnpm.io/install.ps1 -useb | iex

其它

shell 复制代码
curl -fsSL https://get.pnpm.io/install.sh | sh -

Or

shell 复制代码
wget -qO- https://get.pnpm.io/install.sh | sh -

Or

shell 复制代码
npm install -g pnpm

设置镜像

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

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

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

yarn

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

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

# 还原为官方镜像源
yarn config set registry https://registry.yarnpkg.com/
相关推荐
SP八岐大兔1 小时前
NPM管理OpenClaw安装、卸载及运维命令
运维·前端·npm·openclaw
陈佬昔没带相机12 小时前
GitHub clone 不动、pip 卡住、brew 转圈?一份指南搞定
git·npm
Irene19911 天前
卸载依赖:pnpm 虚拟存储路径不一致
pnpm·卸载依赖
奔跑的呱呱牛1 天前
xlsx 已停止维护且存在漏洞!推荐一个可直接替代的 npm 库
前端·npm·node.js·xlsx·sheetjs
Ztopcloud极拓云视角2 天前
Claude Code 源码泄露事件技术复盘:npm sourcemap 配置失误的完整分析
前端·npm·node.js
赖念安2 天前
在 vscode 的 NPM SCRIPTS 面板点击执行后脚本失败
ide·vscode·npm
Moshow郑锴2 天前
npm国内镜像加速之使用 nrm 工具(灵活切换,适合多环境)
前端·npm·node.js
"Wild dream"3 天前
NodeJs内置的Npm
前端·npm·node.js
OPHKVPS4 天前
黑客反被黑:研究人员利用 XSS 漏洞劫持 StealC 控制面板,窃取攻击者情报
前端·网络·npm
zybsjn4 天前
npm warn Unknown global config “--init.module“ 问题排查与解决实践
npm