node安装: /lib64/libm.so.6: version `GLIBC_2.27‘ not found

entos7 安装18版本以上的node js

1.1 安装高版本gcc与g++
yum install -y centos-release-scl
yum install -y devtoolset-8-gcc*
mv /usr/bin/gcc /usr/bin/gcc-4.8.5
ln -s /opt/rh/devtoolset-8/root/bin/gcc /usr/bin/gcc
mv /usr/bin/g++ /usr/bin/g++-4.8.5
ln -s /opt/rh/devtoolset-8/root/bin/g++ /usr/bin/g++
1.2 升级make到4版本
wget http://ftp.gnu.org/gnu/make/make-4.3.tar.gz
tar -xzvf make-4.3.tar.gz && cd make-4.3/
./configure  --prefix=/usr/local/make
make && make install
cd /usr/bin/ && mv make make.bak
​
ln -sv /usr/local/make/bin/make /usr/bin/make
1.3 升级bison

yum install -y bison

1.4 安装glibc-2.28
wget http://ftp.gnu.org/gnu/glibc/glibc-2.28.tar.gz
cd glibc-2.28/ && mkdir build  && cd build
cd /root/glibc-2.28/build
../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin
make && make install
1.5 升级liibstc++
wget https://cdn.frostbelt.cn/software/libstdc%2B%2B.so.6.0.26
//安装libstdc++.so.6.0.26
解压文件 拷贝到 /usr/lib64/libstdc++.so.6
rm -rf /usr/lib64/libstdc++.so.6
ln -s /usr/lib64/libstdc++.so.6.0.26 /usr/lib64/libstdc++.so.6
1.6安装node版本管理工具
wget https://github.com/nvm-sh/nvm/archive/refs/tags/v0.38.0.
tar -zxvf v0.38.0. /usr/local
​
export NVM_DIR="$HOME/usr/local/nvm-0.39.0"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
​
##设置默认版本
nvm alias default v16.20.1
​

你可能感兴趣的:(node.js)