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/
相关推荐
Avan_菜菜10 小时前
Nuxt3 中使用 pnpm 安装的 NuxtImg 使用会提示找不到图片
前端·npm·nuxt.js
抠脚小弟12 小时前
实现vue组件库并发布npm上使用流程
前端·vue.js·npm
HarryHY13 小时前
检查项目中的依赖是否有更新——npm outdated
前端·npm·node.js
持久的棒棒君1 天前
npm安装electron下载太慢,导致报错
前端·electron·npm
陪我一起学编程1 天前
关于nvm与node.js
vue.js·后端·npm·node.js
小声读源码2 天前
【技巧】dify前端源代码修改第一弹-增加tab页
前端·pnpm·next.js·dify
前端百草阁2 天前
从npm库 Vue 组件到独立SDK:打包与 CDN 引入的最佳实践
前端·vue.js·npm
夏日米米茶2 天前
Windows系统下npm报错node-gyp configure got “gyp ERR“解决方法
前端·windows·npm
蓝胖子的多啦A梦2 天前
npm : 无法加载文件 C:\Program Files\nodejs\npm.ps1,因为在此系统上禁止运行脚
前端·npm·node.js
qziovv3 天前
Pnpm的使用
npm