1 .先安装nvm
```bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
```
安装成功后有上面图片的提示,
红框框就是环境变量的设置方法
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion
=> Compressing and cleaning up git repository => Appending nvm source string to /home/coder/.bashrc => Appending bash_completion source string to /home/coder/.bashrc => Close and reopen your terminal to start using nvm or run the following to use it now:
任意使用哪一种都行
执行你选择的命令后
nvm install 14.16.0
nodejs就按钮好了,其中14.16.0 是node版本号



