nvm网址:https://github.com/nvm-sh/nvm
我安装的步骤
1、终端运行安装指令
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
2、安装成功后配置环境变量
vi ~/.bashrc(i->插入,粘贴红框内容,esc, :wq) source ~/.bashrc
touch .bash_profile open .zshrc(粘贴红框内容) source .bash_profile
touch .zshrc open .zshrc(粘贴红框内容) source .zshrc
3、安装node
nvm list
nvm install node版本号
nvm use node版本号