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/
相关推荐
Qrun14 小时前
Windows11安装nvm管理node多版本
前端·vscode·react.js·ajax·npm·html5
中国lanwp14 小时前
全局 npm config 与多环境配置
前端·npm·node.js
中国lanwp1 天前
npm中@your-company:registry 和 registry 的区别
前端·npm·node.js
这是个栗子2 天前
【问题解决】用pnpm创建的 Vue3项目找不到 .eslintrc.js文件 及 后续的eslint配置的解决办法
javascript·vue.js·pnpm·eslint
Hilaku3 天前
就因为package.json里少了个^号,我们公司赔了客户十万块
前端·javascript·npm
金梦人生5 天前
让 CLI 更友好:在 npm 包里同时支持“命令行传参”与“交互式对话传参”
前端·npm
ByteCraze5 天前
一文讲透 npm 包版本管理规范
前端·arcgis·npm
Dontla5 天前
npm install命令介绍
前端·npm·node.js
Airser6 天前
npm启动Taro框架报错
前端·npm·taro
xiecoding.cn6 天前
NPM下载和安装图文教程(附安装包)
npm·node.js·npm install·npm安装·npm是什么·安装npm·npm下载