Node与GLIBC_2.27不兼容解决方案
# 报错信息
[root@VM-8-5-centos ~]# node -v
node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
1
2
3
4
5
6
7
2
3
4
5
6
7
# 解决方案
使用 node-vxxx-linux-x64-glibc-217.tar.gz
版本的Node
包解决
# 1、下载安装包
在 https://unofficial-builds.nodejs.org/download/release (opens new window) 下载你需要的版本安装包。
# linux 下载 v18.18.0 示例:
wget https://unofficial-builds.nodejs.org/download/release/v18.18.0/node-v18.18.0-linux-x64-glibc-217.tar.gz
1
2
2
# 2、上传服务器
压缩文件上传到指定目录下,我这里下载到/root
目录下。
# 3、解压
tar -xzvf node-v18.18.0-linux-x64-glibc-217.tar.gz
1
# 4、将文件名改短
mv node-v18.18.0-linux-x64-glibc-217 node-v18
1
# 5、编辑环境变量
vim /etc/profile
1
文件末尾新增内容如下:
export NODE_HOME=/root/node-v18
export PATH=.:$NODE_HOME/bin:$PATH
1
2
2
# 6、重新加载环境变量
source /etc/profile
1
# 7、配置阿里云镜像仓库
npm config set registry=https://registry.npmmirror.com
1
上次更新: 2024/08/19, 17:40:54
- 02
- Git清空本地文件跟踪缓存08-13