Skip to content

Commit 9d7d778

Browse files
committed
Add installation instructions for yarn and yrm to the nvm guide
1 parent 085163d commit 9d7d778

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

docs/guide/install/nvm.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,46 @@ nrm current
122122

123123
> 此时,在 `~/.npmrc` 配置中自动配置:`registry=https://registry.npmmirror.com/`
124124
125-
## 安装 yarn
125+
## yarn
126+
127+
### 安装
126128

127129
[`yarn`](https://yarnpkg.com/) 是一个快速、可靠、安全的依赖管理工具。
128130

129131
```shell
130132
npm -g install yarn
131133
```
132134

135+
### [nrm](https://github.com/i5ting/yrm)
136+
137+
`yrm``yarn` 镜像仓库管理命令,可以帮助我们管理 `yarn` 镜像资源的下载地址。
138+
139+
```shell
140+
npm install -g yrm
141+
```
142+
143+
> 鉴于国内网络环境,如果下载速度慢或者下载失败,建议修改 npm 的从淘宝镜像地址下载资源,可以执行命令:`npm install -g yrm --registry=https://registry.npmmirror.com/`
144+
145+
#### 查看可用源
146+
147+
```shell
148+
yrm ls
149+
```
150+
151+
#### 使用指定源
152+
153+
```shell
154+
yrm use taobao
155+
```
156+
157+
#### 检查当前使用源
158+
159+
```shell
160+
yrm current
161+
```
162+
163+
> 此时,在 `~/.yarnrc` 配置中自动配置:`registry "https://registry.npm.taobao.org/"``~/.npmrc` 配置中自动配置:`registry=https://registry.npmmirror.com/`
164+
133165
## 安装 bun
134166

135167
[`bun`](https://bun.sh/) 是一个用于快速创建项目的脚手架工具。

0 commit comments

Comments
 (0)