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/
相关推荐
钝挫力PROGRAMER3 小时前
npx 与 npm 全局安装/更新/卸载
npm·npx·mcp·dsh
天若有情6732 天前
开源轻量双语工具|一键批量查询 NPM 包历史下载量,支持按作者批量统计
javascript·npm·github pages·开源工具·netlify·前端开源·npm克隆量
柚稚姐姐6 天前
npm install pnpm -g npm error code EACCES npm error syscall symlink
前端·npm·node.js
D_jing206 天前
【踩坑解决】pnpm+Vite引入@koi/core报错spark-md5找不到模块(幽灵依赖深度解析)
pnpm·vite·幽灵依赖·前端踩坑
晴天167 天前
npm install -f(--force)深度解析:作用原理、报错根源与风险避坑指南
前端·npm·node.js
晴天167 天前
.npmrc 配置文件全解析:从换源到工程化的完整指南
npm·npmrc
晴天168 天前
peerDependencies 全面解析:前端依赖生态的核心机制与实战指南
前端·npm
ha_lydms11 天前
HDFS 简介
大数据·hadoop·hdfs·yarn·调度·aliyun·计算
晴天1611 天前
打造自己的 npm 包实战指南
前端·npm·node.js
西西小飞龙11 天前
npm vs pnpm
前端·npm·node.js