由于更换了一个32位的linux系统云服务器(便宜 :-)),重新安装环境的时候踩了不少坑。最开始是照着网上通过命令 wget https://nodejs.org/dist/v12.13.0/node-v12.13.0-linux-x64.tar.xz 来下载压缩包来直接部署,结果出现 cannot execute binary file 错误,这是因为32位的系统不能安装64位的nodejs, 可是官网上又没有32位的编译包,这可怎么办呢。之后我又尝试使用yum, 首先指定版本:curl --silent --location https://rpm.nodesource.com/setup_12.x | bash - ,结果又报错Your distribution, identified as "centos-release-6-9.el6.12.3.i686", is not currently supported...意思就是不支持你这个操作系统。。
万万没想到,最后我还是安装成功了。完整记录如下:
安装gcc/c++/g++,用于编译
wget http://people.centos.org/tru/devtools-2/devtools-2.repo
mv devtools-2.repo /etc/yum.repos.d
yum install devtoolset-2-gcc devtoolset-2-binutils devtoolset-2-gcc-c++
ln -s /opt/rh/devtoolset-2/root/usr/bin/gcc /usr/bin/gcc
ln -s /opt/rh/devtoolset-2/root/usr/bin/c++ /usr/bin/c++
ln -s /opt/rh/devtoolset-2/root/usr/bin/g++ /usr/bin/g++
安装Nodejs12.13.0
yum -y install make openssl-devel wget
wget https://nodejs.org/dist/v12.13.0/node-v12.13.0.tar.gz
tar -zvxf node-v12.13.0.tar.gz
cd node-v12.13.0
./configure
make && make install
安装mysql5.5
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
rpm -Uvh http://mirrors.neusoft.edu.cn/epel/6/i386/epel-release-6-8.noarch.rpm
yum --enablerepo=remi,remi-test install mysql mysql-server
启动mysql
service mysqld start