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/
相关推荐
前端百草阁7 小时前
从npm库 Vue 组件到独立SDK:打包与 CDN 引入的最佳实践
前端·vue.js·npm
夏日米米茶7 小时前
Windows系统下npm报错node-gyp configure got “gyp ERR“解决方法
前端·windows·npm
蓝胖子的多啦A梦11 小时前
npm : 无法加载文件 C:\Program Files\nodejs\npm.ps1,因为在此系统上禁止运行脚
前端·npm·node.js
qziovv12 小时前
Pnpm的使用
npm
XI锐真的烦15 小时前
横向对比npm和yarn
前端·npm·node.js
飞鸟malred1 天前
vite+tailwind封装组件库
前端·react.js·npm
好运yoo2 天前
npm install的原理
前端·npm
pzpcxy5203 天前
安装VUE客户端@vue/cli报错警告npm WARN deprecated解决方法 无法将“vue”项识别为 cmdlet、函数
前端·vue.js·npm
醉书生ꦿ℘゜এ3 天前
npm error Cannot read properties of null (reading ‘matches‘)
前端·npm·node.js
Revol_C3 天前
【AI+赋能前端-提效篇】开发一个支持项目打包产物本地调试的小工具,已发布到npm!!
前端·npm·ai编程