安装

  1. yum install -y nodejs

查看安装的版本

  1. node -v

安装n管理包,安装指定的nodejs版本

  1. npm install -g n

更新NodeJs版本

参考文档