6
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)

I am getting this error, when I run the command npm install or node -v.

How to solve this error? I have tried reinstalling node but it didn't work.

I am trying to create a react app and installing node modules using npm. I am using Ubuntu 18.04.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
  • Does this answer your question? https://stackoverflow.com/questions/72921215/getting-glibc-2-28-not-found – MrDiamond Dec 17 '22 at 19:26

2 Answers2

5

Here i already answered to a similar question. Install Nodejs v18 on Ubuntu 18.04

Allthough it is related to docker, the result is the same. Seams that ubuntu 18.04 is not nativly supported by nodejs anymore.

If you are using Ubuntu 18.04 as your Host-Os, consider updating it to 20.04 or 22.04. Im running node18 on Ubuntu 22.04. No issues! Consider to install a node version manager. This allows you to switch easily between different node versions.

https://github.com/nvm-sh/nvm

Here an article how you can do that: https://tecadmin.net/how-to-install-nvm-on-ubuntu-20-04/

Last solution, if you are familiar with docker, could be executing your app inside a docker container with node18.

If all this is not an option for you, downgrade to node16, which is still supported till september 2023.

Ralle Mc Black
  • 1,065
  • 1
  • 8
  • 16
1

I got solution use following steps.

sudo apt-get remove nodejs 
nvm install 16.15.1

node & npm v16.15.1 version is installed.

desertnaut
  • 57,590
  • 26
  • 140
  • 166