nvm-cn/README.md
2024-05-26 00:41:22 +08:00

75 lines
2.4 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div align="center">
# nvm-cn
</div>
<br>
**2023年始至2023年9月仅该仓库共有 6000+ 独立IP访问您的贡献将会给他人带来实际帮助。**
`nvm-cn` 解决的是 NodeJS 自身的国内下载问题,而 **npm 包** 的国内下载问题,您可阅读最下方手动进行换源,或通过 [RubyMetric/chsrc] 多平台自动测速换源。
<br>
## 维护消息
- **`<2023-09-07>` 该仓库所在组织名由 RubyKids 变更为 **RubyMetric**并有新成员加入组织。更名带来的不便请您谅解之前的URL还可以自动跳转到这里[变更原因](https://gitee.com/RubyMetric/discussion/issues/I7ZA68)**。
- `<2023-07-20>` 由Gitee官方追踪的上游仓库不知何时意外被删除现暂时切换至备用仓库由我手动更新。待恢复后再切换回Gitee管理的仓库。
- `<2023-05-01>` 此仓库现在切换使用Gitee官方管理的`nvm`镜像,每日更新,最多只比上游晚一天。因此现在不再需要依赖我手动更新。(我已为此手动更新两年,至少每两周一次)
- `<2022-11-07>` 此仓库最开始只是方便我自己临时使用,跟随 RubyKids 的其他项目一起公开出来了。但目前我很少使用 NodeJS对其生态不是很熟悉若出现问题希望您参与帮助。如果您愿意长时间维护这个项目请联系我我将很乐意为你打开相关权限。请查看 [Woody's voice box 理念](https://gitee.com/RubyMetric/discussion/issues/I7ZAMA)
<br>
## 安装
`bash -c "$(curl -fsSL https://gitee.com/RubyMetric/nvm-cn/raw/main/install.sh)"`
## 卸载
`bash -c "$(curl -fsSL https://gitee.com/RubyMetric/nvm-cn/raw/main/uninstall.sh)"`
## 使用
```bash
nvm ls
# 列出所有可安装版本
nvm ls-remote
# 安装某个版本Node
nvm install lts/fermium
nvm install v12.20.1
nvm install v15.5.1
# 切换Node版本
nvm use system
nvm use 14.15 # 不用全部打出版本号
# 更新nvm
nvm-update
```
<br>
## npm 换源
推荐您使用C语言编写的全平台换源工具 [RubyMetric/chsrc]
![chsrc](https://gitee.com/RubyMetric/chsrc/raw/main/image/example.png)
`chsrc` 将测速挑选最快镜像站,并自动执行下述命令:
```bash
# 查看配置
npm config ls
npm config set registry https://registry.npmmirror.com
```
[RubyMetric]: https://gitee.com/RubyMetric
[RubyMetric/chsrc]: https://gitee.com/RubyMetric/chsrc