Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node.js is showing error "node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)" #52241

Open
yogeshlc opened this issue Mar 28, 2024 · 11 comments

Comments

@yogeshlc
Copy link

Version

node-v20.11.0-linux-x64.tar.xz

Platform

Linux yogVM 5.4.17-2136.325.5.1.el7uek.x86_64

Subsystem

No response

What steps will reproduce the bug?

  • Extract node.js tar at location /usr/local
  • check node --version cmd which is failing with error
    Error:
    node --version
    node: /lib64/libm.so.6: version GLIBC_2.27' 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 CXXABI_1.3.9' not found (required by node) node: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by node)
    node: /lib64/libc.so.6: version GLIBC_2.28' not found (required by node) node: /lib64/libc.so.6: version GLIBC_2.25' not found (required by node)

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior? Why is that the expected behavior?

node --version
v20.11.0

What do you see instead?

node --version
node: /lib64/libm.so.6: version GLIBC_2.27' 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 CXXABI_1.3.9' not found (required by node) node: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by node)
node: /lib64/libc.so.6: version GLIBC_2.28' not found (required by node) node: /lib64/libc.so.6: version GLIBC_2.25' not found (required by node)

Additional information

No response

@ryker-uptycs
Copy link

This error happens when you install Node on an operating system that has a version of GLIBC that is lower than Node can support. For example, Node v20 supports GLIBC v2.27 or later. When you attempt to install Node v20.x on any Linux OS that has GLIBC v2.27 or lower, you will get such errors.

To see the version of GLIBC that your operating system has, execute the ldd command on the terminal:

$ ldd --version
you will get output like this.

ldd (Ubuntu GLIBC 2.35-0ubuntu3.6) 2.35

I can suggest three options to resolve this issue:

  • Either install Node from source code. This will allow you to recompile

  • Or install an older version of Node that your OS can support

  • Or upgrade your Linux OS to a newer version.

@yogeshlc
Copy link
Author

ldd --version
ldd (GNU libc) 2.17

@yogeshlc
Copy link
Author

If Possible can you please share/point me to the location where i can get the steps to recompile?

@Ch3nYuY
Copy link
Contributor

Ch3nYuY commented Mar 29, 2024

# install node from source code
git clone https://github.com/nodejs/node && git checkout v20.11.0
./configure && make -j4

You might also encounter compilation errors related to GLIBC version, which can be resolved by referring to the methods mentioned in #52223.

@makymendez
Copy link

@Ch3nYuY
Thank you!!!

@CrazyMrYan
Copy link

CrazyMrYan commented Jun 3, 2024

I also encountered the same problem where executing "ldd -- version" did not take effect

[root nodejs]# node -v
node: /lib64/libm.so.6: version `GLIBC_2.27' 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 `CXXABI_1.3.9' not found (required by node)
node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.27' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by node)
node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node)

@javaaiorg
Copy link

Use Node.js no depends version can solved this problem:
https://www.javaai.org/a/c892d1e98fd94a64018ff4a88ec9000c

@iamsudip
Copy link

iamsudip commented Jul 8, 2024

https://www.javaai.org/a/c892d1e98fd94a64018ff4a88ec9000c

How can we trust the source code from your website? The website name is so canny, shouldn't install node from there.

@javaaiorg
Copy link

javaaiorg commented Jul 9, 2024

https://www.javaai.org/a/c892d1e98fd94a64018ff4a88ec9000c

How can we trust the source code from your website? The website name is so canny, shouldn't install node from there.

patchelf-recurse is opensource shell script, every one can review it:
https://github.com/javaaiorg/patchelf-recurse

https://www.javaai.org/a/c892d1e98fd94a64018ff34a0b8b0007
If you don't trust my package, you can learn how to use patchelf, and make your self package.

original patchelf's official site (3K stars): https://github.com/NixOS/patchelf
Remember, you need use ](https://github.com/NixOS/patchelf/releases/tag/0.17.2) version, don't use 0.18.0, 0.18.0 has some bugs.

@MonolithFoundation
Copy link

Can't anyone pointed that copy another glibc could resolve this issue easily? without any effect on your system other software.

@MonolithFoundation
Copy link

For anyone get same error that can not install nodejs higher version on GLIBC2.17 such as centos7.

https://unofficial-builds.nodejs.org/download/

This is all you need, just install the prebuilt binary with glibc2.17.

Download it unzip it, then make PATH to bin, then you are all done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants