node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
Assistant
The error message:
code
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
means that the Node.js binary you are trying to run requires at least version 2.28 of the GNU C Library (glibc), but your system has an older version installed.
Why this happens:
Your current system glibc version is older than 2.28.
Node.js was linked against glibc 2.28 or newer, so it needs that version at runtime.
How to fix it
1. Check your currently installed glibc version:
bash
ldd --version
The first line will say something like:
code
ldd (Ubuntu GLIBC 2.27-3ubuntu1) 2.27
If it is lower than 2.28, that confirms the issue.
2. Upgrade your glibc version
Warning: Upgrading glibc manually can break your system if not done correctly, especially on production systems.
a. Using your system package manager (recommended):
If you're on Ubuntu or Debian and have an older release, you might need to upgrade your OS or use a newer LTS version that comes with glibc 2.28+.
On Ubuntu, for example:
Ubuntu 18.04 comes with glibc 2.27.
Ubuntu 19.04 and later come with glibc 2.28 or newer.
If upgrading your entire OS is possible, that's usually the safest approach.
b. Building and installing glibc 2.28 locally (advanced):
If you cannot upgrade your OS, you can build and install glibc 2.28 in a local directory (e.g., /opt/glibc-2.28) and configure Node.js to use it.
Download glibc 2.28 sources:
bash
wget http://ftp.gnu.org/gnu/libc/glibc-2.28.tar.gz
tar -xzvf glibc-2.28.tar.gz
cd glibc-2.28
Build and install to /opt/glibc-2.28
bash
mkdir /opt/glibc-2.28
mkdir build
cd build
../configure --prefix=/opt/glibc-2.28
make -j$(nproc)
sudo make install
Run Node.js using the new library:
bash
User
I wante Use older Node.js version
Assistant
If you want to use an older Node.js version that works with your current glibc (which is older than 2.28), here's how you can proceed:
1. Find your current glibc version
Run:
bash
ldd --version
Note the version number, e.g. 2.27.
2. Find a Node.js version compatible with your glibc version
Node.js binaries are linked to specific minimum glibc versions.