wget https://github.com/nvm-sh/nvm/archive/refs/tags/v0.38.0.tar.gz
mkdir -p /root/.nvm
tar -zxvf v0.38.0.tar.gz -C /root/.nvm
编辑~/.bashrc
vim ~/.bashrc
export NVM_DIR="$HOME/.nvm/nvm-0.38.0" # 注意位置是不是一致的
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
source ~/.bashrc
nvm install 12
注:系统原有的node将失效
node——nvm ls
node——nvm uninstall xxx
node——nvm use xxx
yum install "gcc-c++.x86_64"