yum install nodejs
但是版本很低【6.17.1】
参考:链接
1、删除旧版本
yum remove nodejs
2、添加Node.js Yum存储库
最新发布: yum clean all && yum makecache fast yum install -y gcc-c++ make curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash - 稳定发布: yum clean all && yum makecache fast yum install -y gcc-c++ make curl -sL https://rpm.nodesource.com/setup_10.x | sudo -E bash -
3、安装
yum install nodejs
4、验证
node -v npm -v
参考:链接
原文:https://www.cnblogs.com/pam-sh/p/14347132.html