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/
相关推荐
热爱生活的五柒10 小时前
解决 npm install 一直在转圈的问题
前端·npm·node.js
小杨勇敢飞15 小时前
npm 安装 @openai/codex 后无法调用 codex 命令的完整解决过程:‘codex‘ 不是内部或外部命令,也不是可运行的程序或批处理文件。
前端·npm·node.js
ricky_fan18 小时前
(已解决)安装openclaw龙虾[特殊字符]npm权限问题EACCES
前端·npm·node.js
Once_day19 小时前
node.js(1)ubuntu安装node和npm
ubuntu·npm·node.js
程序员讲BPM工作流20 小时前
npm非全局方式安装小龙虾OpenClaw
前端·npm·node.js
spencer_tseng20 小时前
vue npm-cache log
vue.js·npm
大傻^21 小时前
【OpenClaw -01】OpenClaw 安装部署指南:npm、Docker 与源码三种模式详解
前端·docker·npm
南宫码农21 小时前
Node.js和npm本地安装详细教程(全系统适配)
前端·npm·node.js
LiuMingXin21 小时前
断网也能装包? 我在物理隔离内网搭了一套完整的私有npm仓库
前端·面试·npm