文章目录
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/