高版本需要升级GCC库,懒得升了。
1、下载nodejs
https://nodejs.org/dist/latest-v10.x/node-v10.24.0-linux-x64.tar.xz
wget https://nodejs.org/dist/latest-v10.x/node-v10.24.0-linux-x64.tar.xz
2、移动解压
mv node-v10.24.0-linux-x64.tar.xz /usr/local/
cd /usr/local/node-v10.24.0/bin/
ln -s /usr/local/node-v10.24.0/bin/node /usr/local/bin
ln -s /usr/local/node-v10.24.0/bin/npm /usr/local/bin
ln -s /usr/local/node-v10.24.0/bin/npx /usr/local/bin
3、切换源并安装forever
npm config set registry http://registry.npm.taobao.org/
npm install forever -g
ln -s /usr/local/node-v10.24.0/bin/forever /usr/local/bin
forever start /opt/xxxxxxxxxxxxxxxx/index.js