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/
相关推荐
程序铺子21 小时前
如何使用 npm 安装 sqlite3 和 canvas 这些包
javascript·npm·node.js
gc_22992 天前
Ape.Volo项目启动前端项目时报错“digital envelope routines::unsupported”
npm
SHUIPING_YANG3 天前
完美迁移:将 nvm 和 npm 完全安装到 Windows D 盘
前端·windows·npm
问道飞鱼3 天前
【前端知识】npm依赖升级以及冲突解决
前端·arcgis·npm·升级·冲突解决
美酒没故事°4 天前
npm源管理器:nrm
前端·npm·npm源
三十_A4 天前
【实录】使用 patch-package 修复第三方 npm 包中的 Bug
前端·npm·bug
孟陬4 天前
一个专业的前端如何在国内安装 `bun`
npm·github·bun
子兮曰4 天前
npm workspace 深度解析:与 pnpm workspace 和 Lerna 的全面对比
前端·javascript·npm
孟陬4 天前
一个专业的前端如何在国内安装 `pnpm`
npm·node.js·bun
星觅5 天前
npm依赖结构解析
npm