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/
相关推荐
行星0082 天前
mac 通过homebrew 安装和使用nvm
macos·npm·node.js
xrkhy3 天前
nvm安装详细教程(卸载旧的nodejs,安装nvm、node、npm、cnpm、yarn及环境变量配置)
前端·npm·node.js
领创工作室3 天前
npm介绍,指令合集,换源指令
前端·npm·node.js
小妖6664 天前
npm run 命令传递参数
前端·npm·node.js
Hilaku4 天前
深入理解npm、pnpm和yarn的lock文件,我发现了一些细节
前端·javascript·npm
mon_star°5 天前
有趣的 npm 库 · json-server
前端·npm·json
yourkin6669 天前
npm run 常见脚本
前端·npm·node.js
我不是李.杨10 天前
解决 npm i node-sass@4.12.0 安装失败异常 npm i node-sass异常解决
rust·npm·sass
艾小码10 天前
三大 Node.js 包管理器对决:npm、yarn、pnpm 深度横评
npm·yarn
金金金__11 天前
无废话,直接干,一篇短篇教你利用Corepack安装Yarn~
npm·yarn