一、安装nodejs环境
linux发行版本支持nodejs参考地址:https://github.com/nodesource/distributions
1、安装nodesource
# As root
curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash -
# No root privileges
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
上述命令的意思是用bash执行一边 | 管道符前面的输出流,其实就是使用bash命令安装setup_lts.x包
2、安装后,执行yum命令安装nodejs
yum install -y nodejs
查看node版本
node -v