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/
相关推荐
Lovely Ruby3 小时前
[前端] 封装一下 echart 6,发布到 npm
前端·npm·node.js
BD_Marathon3 小时前
NPM_常见命令
前端·npm·node.js
雪域迷影4 小时前
怎么将.ts文件转换成.js文件?
javascript·typescript·npm·tsc
安_4 小时前
为什么 Vue 要用 npm run dev 启动
前端·vue.js·npm
暴富的Tdy1 天前
【脚手架创建 Vue3 公共组件库】
前端·npm·npm发布
BD_Marathon1 天前
【JavaWeb】NPM_简介和相关配置
前端·npm·node.js
BD_Marathon1 天前
NPM_配置的补充说明
前端·npm·node.js
soul g2 天前
npm 包发布流程
前端·npm·node.js
Y‍waiX‍‍‮‪‎⁠‌‫‎‌‫‬2 天前
【npm】从零到一基于Vite+vue3制作自己的Vue3项目基础的npm包并发布npm
前端·npm·node.js
elangyipi1232 天前
pnpm 深度解析:下一代包管理工具的原理与实践
npm·node.js