skip to Main Content

I running node -v command getting error:-
node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28′ not found (required by node)

enter image description here

Any solution

12

Answers


  1. Chosen as BEST ANSWER

    Finally I got solution by running by running following commands.

    sudo apt-get remove nodejs
    nvm install 16.15.1
    

    node v16.15.1 version and npm v16.15.1 is installed. For same make sure nvm is installed in your machine.


  2. You likely have a node version installed that is compiled for a different ubuntu release to the one you are running.

    I would suggest removing it, then installing the nodesource binary distribution. It should auto-detect your ubuntu release and install the correct node release.

    Login or Signup to reply.
  3. You got the issue because node version is not compatible with ubuntu. IN my case, I got the same issue with Ubuntu 18 & Node 16.15.1.

    Using this command to check GLIBC version

    ldd --version
    

    My version is 2.27. So I has tried to fix by change the nodejs version.

    sudo apt-get remove nodejs
    nvm install 14.17.6
    
    Login or Signup to reply.
  4. This issue can be resolved by switching to stable available node version. You can switch to the stable node version with the below command.

    nvm install --lts
    

    Then, Use nvm alias default {VERSION} to switch the version of Node.js used by default when starting a new shell.

    Login or Signup to reply.
  5. you can install node v17.x by nvm(nodejs version manager).

    my OS version: Ubuntu 18.04.6 LTS

    I tried three ways to install node and npm in my pc:

    1. (fail) apt-get, the version is very old

      $ sudo apt-get install nodejs
      $ sudo apt-get install npm
      $ node -v
      v8.10.0
      $ npm -v
      6.1.0
      
    2. (fail) script from source code of nodejs, only node is updated, npm is not.
      https://github.com/nodesource/distributions/blob/master/README.md#using-ubuntu-1

      $ curl -sL https://deb.nodesource.com/setup_14.x -o /tmp/nodesource14_setup.sh
      $ node -v
      v14.20.1
      $ npm -v
      6.1.0
      
    3. (success) use nvm

      https://github.com/nvm-sh/nvm#installing-and-updating

      $ sudo apt-get remove nodejs
      $ sudo apt-get remove npm
      
      $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
      $ chmod +x ~/.nvm/nvm.sh
      $ source ~/.bashrc 
      
      $ nvm -v
      0.39.2
      
      $ nvm install 14
      
      $ node -v
      v14.20.1
      $ npm -v
      6.14.17
      
      $ nvm install 16
      
      $ node -v
      v16.18.0
      $ npm -v
      8.19.2
      
      $ nvm install 17
      
      $ node -v
      v17.9.1
      $ npm -v
      8.11.0
      
      # failed to install 18
      $ nvm install 18
      
      $ node -v
      node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
      $ npm -v
      node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
      
    Login or Signup to reply.
  6. i had this issue using :

    • ubuntu 18.04 WSL2
    • Windows 11

    after updating NVM and NPM…

    i fixed it by updating ubuntu to 20.04
    tutorial here :
    https://www.nextofwindows.com/how-to-upgrade-existing-wsl-wsl2-ubuntu-18-04-to-20-04

    Login or Signup to reply.
  7. I’d had the same problem when installing Node with versions greater than or equal 18.
    My solution was upgrade my distribution Ubuntu to version 20.04, followings the steps:

    My requirements before upgrade:

    • Node.js (v18.x)
    • Windows 10
    • WSL 2 (Distribution Ubuntu-18.04)

    Making a backup from your WSL system (for your security)

    if you don’t use WSL you can skip the steps:

    1. Open CMD or PowerShell as Admin.
    2. Stop the WSL instance with wsl --shutdown
    3. Create folder wsl-backup with the command mkdir C:wsl-backup.
    4. Run command wsl --export Ubuntu-18.04 C:wsl-backupubuntu-18.04.tar.

    If there is a problem in the process, you can restore your WSL using the command mkdir C:WSL and wsl --import Ubuntu-18.04 C:WSL C:wsl-backupubuntu-18.04.tar to recover.

    Upgrading Ubuntu 18.04 to 20.04

    1. Removing the Snapd package:

    For me it was necessary to remove the snapd package, because ubuntu was not allowing me to upgrade to 20.04 LTS version

    sudo apt purge snapd
    
    1. Run commands to update and upgrade packages:
    sudo apt update
    sudo apt list --upgradable
    sudo apt upgrade -y
    
    1. Install the update-manger-core package:

    It’s essential to install this update manager core package this will trick the system into thinking there is a new LTS available and allow you to do an in-place upgrade.

    sudo apt install update-manager-core
    
    1. Install the new version with:
    sudo do-release-upgrade
    

    if you are using an LTS version (recommended) and found that there is no new LTS version available it will show this message

    Checking for a new Ubuntu release
    There is no development version of an LTS available.
    To upgrade to the latest non-LTS development release 
    set Prompt=normal in /etc/update-manager/release-upgrades.
    

    If it’s not relevant to you to not use LTS versions, you can change the Prompt to normal in /etc/update-manager/release-upgrades file and rerun the previous command.

    sudo do-release-upgrade -d
    
    1. During installation, will need your interaction to allow installation of the additional packages that come in version 20.04 (Including lib6 that is required by node).

    2. Finished, now can verify your distribution version ubuntu using the command:

    lsb_release -a
    

    You should get an output similar to this

    Distributor ID: Ubuntu
    Description:    Ubuntu 20.04.5 LTS
    Release:    20.04
    Codename:   focal
    

    Now you can use node version >=18

    Install Node 18 with NVM

    Installing node LTS

    In the current date (26/nov/2022) is v18

    nvm install lts
    # or nvm install --lts
    

    Use LTS version

    nvm use lts 
    

    Check node version

    node -v
    # v18.12.1
    

    References:

    Upgrade Ubuntu Version on WSL
    22.04 LTS "sudo do-release-upgrade" does not work
    Can’t upgrade to Ubuntu 21.04 : "Restoring original system state. Aborting"

    Login or Signup to reply.
  8. the root cause is the latest node need glibc2.28 but the Ubuntu 18 only includes glic2.27.

    Solution: 1. use a lower version node, e.g. "sudo apt-get remove nodejs
    nvm install 16.15.1". refer to "Abhay Kumar Upadhyay"’s answer.

    Solution 2: upgrade glibc to glic2.28+. refer to: https://www.digitalocean.com/community/questions/how-install-glibc-2-29-or-higher-in-ubuntu-18-04

    Solution 3: upgrade Ubuntu 18 to 20. refer to "’Hállex da S. Costa"’s answer.

    Login or Signup to reply.
  9. GitHub Actions

    I ended up here after my GitHub Actions build failed with the error:

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

    The problem is ubuntu-18.04 not supporting node 18 (as explained [here](node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28′ not found (required by node))) because of the glibc version bump.

    The solution is to update to ubuntu-20.04 or higher.

    Login or Signup to reply.
  10. Agree with others to remove and reinstall the nodejs, but if you don’t want to uninstall it or you are not sure to remove it, change the version.

    nvm use 16

    Or any version that works for your test. it worked for me!

    Login or Signup to reply.
  11. As per @ys_sunshine, I had change a few things for Rasberry Pi.

    After installing the LTS version as per the following instructions:
    https://pimylifeup.com/raspberry-pi-nodejs/

    curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
    

    I got the following error:

    $ node -v
    node: /lib/arm-linux-gnueabihf/libm.so.6: version `GLIBC_2.27' not found (required by node)
    node: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.25' not found (required by node)
    node: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.28' not found (required by node)
    

    This meant I couldn’t run anything, so I tried the following:

    $ sudo apt-get remove nodejs
    $ sudo apt-get remove npm
    
    $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh > install.sh
    $ chmod +x install.sh
    $ source ~/.bashrc 
    
    
    $ nvm -v
    0.39.2
    
    $ nvm install 14
    
    $ node -v
    v14.22.2
    
    $ npm -v
    6.14.17
    
    Login or Signup to reply.
  12. It means the current version of Linux doesn’t have GLIBC_2.28 which the latest version of Node requires.

    You can run the ldd –version command to check your GLIBC version.

    ldd --version

    You can fix this in two ways:

    1. Install an older, more widely supported version of Node.js (16.X).
    2. Upgrade your Linux operating system to a newer version.

    Just Changing your node version to 16 is the fastest solution and it worked for me.

    nvm install 16
    nvm use 16
    

    if You don’t have NVM(Node Version Manager)
    Then Install Using:

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search