控制台输入命令:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
3、如果输出的是打印信息:
=> Close and reopen your terminal to start using nvm or run the following to use it now:
export NVM_DIR=“ H O M E / . n v m " [ − s " HOME/.nvm" [ -s " HOME/.nvm"[−s"NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh” # This loads nvm
4、控制台输入:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
5、控制台输入:nvm,控制台显示:Node Version Manager, 即安装nvm成功
6、安装版本
nvm install 8.9.3
nvm install 12.16.2
7 、使用某一版本设置
nvm use 8.9.3
8、命令查看node版本
node -v