安装node的版本问题记录

在服务器中离线安装node.js环境,下载官网下载最新的Linux 二进制文件 (x64),node-v16.16.0-linux-x64.tar.xz。

上传至服务器中解压,运行./node -v后,提示:

lib64/libm.so.6: version 'GLIBC_2.28' not found (required by node)

是因为高版本的nodejs需要更高版本的glibc编译环境,目前我的服务器对应的glibc最高只能支持到2.27。

通过命令strings /lib/i386-linux-gnu/libc.so.6 | grep ^GLIBC查看当前系统glibc的版本。
在这里插入图片描述
贸然更新glibc的版本存在较大的风险,所以建议降低node.js的版本,去兼容低版本glibc

搜索历史版本,查看软件更新日志,通过搜索关键字glibc。

软件在V18.0.0修改依赖glibc 2.28,所以我们下载使用Node.js 17.9.1版本,问题解决。

2022-04-19, Version 18.0.0 (Current), @BethGriggs

Node.js 18 is here! Highlights include the update of the V8 JavaScript engine to 10.1, global fetch enabled by default, and a core test runner module.

Initially, Node.js 18 will replace Node.js 17 as our ‘Current’ release line. As per the release schedule, Node.js 18 will be the ‘Current’ release for the next 6 months and then promoted to Long-term Support (LTS) in October 2022. Once promoted to long-term support the release will be designated the codename ‘Hydrogen’. Node.js 18 will be supported until April 2025.

Toolchain and Compiler Upgrades

Prebuilt binaries for Linux are now built on Red Hat Enterprise Linux (RHEL) 8 and are compatible with Linux distributions based on glibc 2.28 or later, for example, Debian 10, RHEL 8, Ubuntu 20.04.
Prebuilt binaries for macOS now require macOS 10.15 or later.
For AIX the minimum supported architecture has been raised from Power 7 to Power 8.

原文链接:https://blog.csdn.net/cike626/article/details/126230536

如果在记录的日志中找不到对应适合的版本的话, 建议可以安装不同版本的node来逐步尝试。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值