nvm 是node版本管理工具,跟node的n包基本功能是一样的。
nvm的github地址是https://github.com/nvm-sh/nvm,其中安装命令如下:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
不过基本上肯定超时,一个比较好的办法是使用国内的gitee来做这个事情。
其gitee仓库地址是https://gitee.com/mirrors/nvm,获取脚本的地址是https://gitee.com/mirrors/nvm/raw/master/install.sh
这样只需要把上边的安装方法修改成
curl -o- https://gitee.com/mirrors/nvm/raw/master/install.sh | bash
这样就能安装成功了。
查看安装版本
nvm -v
之后安装稳定版本
nvm install --lts
之后就能安心的开发了~