常规安装
# 下载node压缩包wget https://npm.taobao.org/mirrors/node/v10.6.0/node-v10.6.0-linux-x64.tar.xz# 解压tar -xvf node-v10.6.0-linux-x64.tar.xz# 更改node安装目录mv node-v10.6.0-linux-x64 /root/node# 配置全局环境变量# 查找forever的安装路径find / -name node# 我这里查到是在:/node/bin/,添加forever到PATHvi /etc/profile# 在结尾的地方添加记录export PATH=$PATH:/node/bin# 重建缓存source /etc/profile
yum安装
# 设置yum源curl --silent --location https://rpm.nodesource.com/setup_10.x | bash# 安装yum install -y nodejs# 制作软链接ln -s /usr/bin/node /usr/sbin/node
