nvm-cn
git地址:https://gitee.com/RubyMetric/nvm-cn?_from=gitee_search
git仓库:https://gitee.com/RubyMetric/nvm-cn.git
nvm-cn 解决的是 NodeJS 自身的国内下载问题,而 npm 包 的国内下载问题,您可阅读最下方手动进行换源,或通过 RubyMetric/chsrc 多平台自动测速换源。
安装
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)”
使用
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
npm 换源
推荐您使用C语言编写的全平台换源工具 RubyMetric/chsrc
chsrc
chsrc 将测速挑选最快镜像站,并自动执行下述命令:
查看配置
npm config ls
npm config set registry https://registry.npmmirror.com