NodeJs之npm、yarn、pnpm设置最新的淘宝镜像下载源
文章目录
- NodeJs之npm、yarn、pnpm设置最新的淘宝镜像下载源
- [1. 查看默认的下载源](#1. 查看默认的下载源)
-
- [1. npm](#1. npm)
- [2. yarn](#2. yarn)
- [3. pnpm](#3. pnpm)
- [2. 设置最新的淘宝镜像地址](#2. 设置最新的淘宝镜像地址)
-
- [1. npm](#1. npm)
- [2. yarn](#2. yarn)
- [3. pnpm](#3. pnpm)
1. 查看默认的下载源
1. npm
shell
C:\Users\jinshengyuan>npm get registry
https://registry.npmjs.org/
2. yarn
shell
C:\Users\jinshengyuan>yarn config get registry
https://registry.yarnpkg.com
3. pnpm
shell
C:\Users\jinshengyuan>pnpm get registry
https://registry.npmjs.org/
2. 设置最新的淘宝镜像地址
淘宝镜像源地址由
https://registry.npm.taobao.org
已替换为https://registry.npmmirror.com
1. npm
shell
# 设置
C:\Users\jinshengyuan>npm config set registry https://registry.npmmirror.com
# 查看
C:\Users\jinshengyuan>npm get registry
https://registry.npmmirror.com/
2. yarn
shell
# 设置
C:\Users\jinshengyuan>yarn config set registry https://registry.npmmirror.com
yarn config v1.22.22
success Set "registry" to "https://registry.npmmirror.com".
Done in 0.03s.
# 查看
C:\Users\jinshengyuan>yarn config get registry
https://registry.npmmirror.com
3. pnpm
shell
# 设置
C:\Users\jinshengyuan>pnpm config set registry https://registry.npmmirror.com
# 查看
C:\Users\jinshengyuan>pnpm get registry
https://registry.npmmirror.com