Last updated: Apr 5, 2024
Reading time·3 min
GLIBC_2.28
not found (required by node)The error "node: version GLIBC_2.28
not found (required by node)" occurs
when the node
binary you're trying to install was built on a GLIBC-2.27
or
more recent system.
To solve the error, install a Node.js version that is compatible with your operating system.
node: /lib64/libm.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: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28` not found (required by node) nvm is not compatible with the npm config "prefix" option: currently set Run `nvm use --delete-prefix v18.0.0` to unset it.
You can run the ldd --version
command to check your GLIBC version.
ldd --version
There are 2 common ways to solve the error:
If you use nvm
, try to issue the following command to install an older Node.js
version that is supported by your operating system.
nvm install 16 nvm use 16
You can use the nvm ls
command to check which nvm
versions you have
installed and which is the currently active version.
nvm ls node --version
If you want to uninstall a specific version, use the nvm uninstall
command.
# 👇️ Uninstall Node.js version 13.X.X nvm uninstall 13
nvm
on your machineIf you don't have nvm
installed, you can install it with the following
command.
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash chmod +x ~/.nvm/nvm.sh source ~/.bashrc
You might have to close and reopen your terminal to be able to use nvm
after
running the commands.
Try issuing the nvm -v
command to verify nvm
is installed.
nvm -v
Install a version that is supported by your operating system, e.g. Node.js v16.
nvm install 16 nvm use 16 nvm ls node --version
You can verify that Node.js is installed correctly by running the following command.
node -e "console.log('Running Node.js ' + process.version)"
If you see a message that contains a version number, then Node.js is installed.
The error commonly occurs when you try to install a newer Node.js version (e.g. 18 or 19) on Amazon Linux AMI because the underlying operating system might not support the version of Node.js you're trying to install.
To get around this, you have to install an older, more widely supported Node.js version.
As noted in the docs, Amazon Linux 2 doesn't currently support the current LTS release (version 18.x) of Node.js.
They recommend using Node.js version 16.x
by running the following nvm
command.
nvm install 16
You can verify that Node.js is installed correctly by running the following command.
node -e "console.log('Running Node.js ' + process.version)"
If you see a message that contains a version number, then Node.js is installed.
n
package to manage your Node.js versionYou can also use the n package to manage your Node.js version.
npm cache clean -f npm install -g n n 16.13.0
If you get a permissions error when issuing the commands, open CMD as an
administrator (Windows) or prefix the commands with sudo
(macOS and Linux).
sudo npm cache clean -f sudo npm install -g n n 16.13.0
Alternatively, you can use the
Previous Releases page of the
official nodejs.org
website to download a specific version of Node.js that is
supported by your operating system.
If the error persists, you can try updating your operating system, e.g. from Ubuntu version 18.04 to Ubuntu version 20.04.
Using the long-term supported version is recommended as the long-term supported version of your OS supports more recent versions of Node.js.
The error "node: version GLIBC_2.28
not found (required by node)" occurs
when the node
binary you're trying to install was built on a GLIBC-2.28
or
more recent system.
You can solve the error by:
You can learn more about using NVM to manage your Node.js version by checking out the following tutorials: