Search code examples
node.jslinuxterminalglibc

Installing node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node) error on linux


I have followed this - How to install node.tar.xz file in linux

in the end while doing node --version I am getting these errors -

enter image description here

What should be done next here?, not able to find proper steps with respect to my scenario.


Solution

  • 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 v18 supports GLIBC v2.7 or later. When you attempt to install Node v18.x on any Linux OS that has GLIBC v2.6 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
    

    I can suggest three options to resolve this issue:

    1. Either install Node from source code. This will allow you to recompile
    2. Or install an older version of Node that your OS can support
    3. Or upgrade your Linux OS to a newer version.

    Reference: Install Node from source code