1.下载二进制包
node-v10.16.0-linux-x64.tar.xz
2.解压到安装目录
xz -d node-v10.16.0-linux-x64.tar.xz tar -xvf node-v10.16.0-linux-x64.tar -C /usr/local/
3.配置软链接
ln -s /usr/local/node-v10.16.0/bin/node /usr/local/bin/ ln -s /usr/local/node-v10.16.0/bin/npm /usr/local/bin/
4.或者配置系统变量环境
export NODE_HOME=/usr/local/node-v10.16.0 export PATH=$NODE_HOME/bin:$PATH
1.下载编译安装包
node-v10.16.0.tar.gz
2.安装编译插件
yum -y install gcc gcc-c++ libxml2-devel bzip2-devel libmcrypt-devel openssl-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel readline-devel libxslt-devel perl-devel psmisc.x86_64 recode-devel libtidy-devel expat-devel curl-devel
3. 进入解压文件夹,执行编译命令
./configure --prefix=/usr/local/node-v10.16.0
4.执行安装命令
make && make install
5.不建议编译安装,gcc版本要求太高