nvm icon indicating copy to clipboard operation
nvm copied to clipboard

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

Open ocixe opened this issue 2 years ago • 8 comments

Operating system and version:

Linux xxx 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux Centos 7

nvm debug output:

nvm --version: v0.39.2 $SHELL: /bin/bash $SHLVL: 1 whoami: 'root' ${HOME}: /root ${NVM_DIR}: '${HOME}/.nvm' ${PATH}: ${NVM_DIR}/versions/node/v19.2.0/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/cpanel/composer/bin:${HOME}/bin $PREFIX: '' ${NPM_CONFIG_PREFIX}: '' $NVM_NODEJS_ORG_MIRROR: '' $NVM_IOJS_ORG_MIRROR: '' shell version: 'GNU bash, version 4.2.46(2)-release (x86_64-redhat-linux-gnu)' uname -a: 'Linux 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux' checksum binary: 'sha256sum' OS version: CentOS Linux 7 (Core) curl: /usr/bin/curl, curl 7.29.0 (x86_64-redhat-linux-gnu) libcurl/7.29.0 NSS/3.53.1 zlib/1.2.7 libidn/1.28 libssh2/1.8.0 wget: /usr/bin/wget, GNU Wget 1.14 built on linux-gnu. git: /usr/local/cpanel/3rdparty/lib/path-bin/git, git version 2.37.4 ls: cannot access alias /usr/bin/grep: No such file or directory grep: alias grep='grep --color=auto' /usr/bin/grep (grep --color=auto), grep (GNU grep) 2.20 awk: /usr/bin/awk, GNU Awk 4.0.2 sed: /usr/bin/sed, sed (GNU sed) 4.2.2 cut: /usr/bin/cut, cut (GNU coreutils) 8.22 basename: /usr/bin/basename, basename (GNU coreutils) 8.22 ls: cannot access alias /usr/bin/rm: No such file or directory rm: alias rm='rm -i' /usr/bin/rm (rm -i), rm (GNU coreutils) 8.22 mkdir: /usr/bin/mkdir, mkdir (GNU coreutils) 8.22 xargs: /usr/bin/xargs, xargs (GNU findutils) 4.5.11 nvm current: which node: ${NVM_DIR}/versions/node/v19.2.0/bin/node which iojs: which: no iojs in (${NVM_DIR}/versions/node/v19.2.0/bin:/usr/local/cpanel/3rdparty/lib/path-bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/cpanel/composer/bin:${HOME}/bin) which npm: ${NVM_DIR}/versions/node/v19.2.0/bin/npm npm config get prefix: node: /lib64/libm.so.6: version GLIBC_2.27' not found (required by node) node: /lib64/libc.so.6: version GLIBC_2.25' not found (required by node) node: /lib64/libc.so.6: version GLIBC_2.28' not found (required by node) node: /lib64/libstdc++.so.6: version CXXABI_1.3.9' not found (required by node) node: /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by node) node: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by node) npm root -g: node: /lib64/libm.so.6: version GLIBC_2.27' not found (required by node) node: /lib64/libc.so.6: version GLIBC_2.25' not found (required by node) node: /lib64/libc.so.6: version GLIBC_2.28' not found (required by node) node: /lib64/libstdc++.so.6: version CXXABI_1.3.9' not found (required by node) node: /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by node) node: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by node)


nvm ls output:

       v18.12.1
        v19.2.0
default -> node (-> v19.2.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v19.2.0) (default)
stable -> 19.2 (-> v19.2.0) (default)
lts/* -> lts/hydrogen (-> v18.12.1)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.21.1 (-> N/A)
lts/gallium -> v16.18.1 (-> N/A)
lts/hydrogen -> v18.12.1

How did you install nvm?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash

What steps did you perform?

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash

What happened?

node: /lib64/libm.so.6: version GLIBC_2.27' not found (required by node) node: /lib64/libc.so.6: version GLIBC_2.25' not found (required by node) node: /lib64/libc.so.6: version GLIBC_2.28' not found (required by node) node: /lib64/libstdc++.so.6: version CXXABI_1.3.9' not found (required by node) node: /lib64/libstdc++.so.6: version GLIBCXX_3.4.20' not found (required by node) node: /lib64/libstdc++.so.6: version GLIBCXX_3.4.21' not found (required by node)

What did you expect to happen?

node working

Is there anything in any of your profile files that modifies the PATH?

If you are having installation issues, or getting "N/A", what does curl -I --compressed -v https://nodejs.org/dist/ print out?


ocixe avatar Dec 12 '22 13:12 ocixe

Sounds like you're using an older OS that doesn't have the appropriate C libraries node requires. You may find you can install node < 18 just fine.

If this is the case, it's about node's support of things and not nvm, and your only option is to upgrade your OS.

ljharb avatar Dec 12 '22 17:12 ljharb

i have same issue. Gatsby 5.x.x node 18.12.1

teachdugsimt avatar Dec 22 '22 13:12 teachdugsimt

@teachdugsimt Gatsby is a JS framework and has nothing to do with anything - i'd need info about your machine.

ljharb avatar Dec 22 '22 18:12 ljharb

I'm running into this issue as well. Posted a (hopefully) helpful fix on Stack Overflow.

Meandmybadself avatar Dec 23 '22 04:12 Meandmybadself

@ljharb problem occurs when I use AWS amplify with Amazon Linux:2 (default) Screen Shot 2565-12-23 at 17 41 37

Screen Shot 2565-12-23 at 17 41 57

teachdugsimt avatar Dec 23 '22 10:12 teachdugsimt

That sounds like an issue that should be reported to AWS.

ljharb avatar Dec 23 '22 15:12 ljharb

I had to downgrade to node 16.16 for aws amplify

johnnytomcat avatar Jan 10 '23 15:01 johnnytomcat

@kekscom @teachdugsimt the thumbs down don't really make sense; nvm can't possibly do anything about missing C libraries on your machine.

ljharb avatar Jan 10 '23 17:01 ljharb

same error ec2-user:~/environment $ nvm install node
v19.4.0 is already installed. Now using node v19.4.0 (npm v) ec2-user:~/environment $ npm install -g @angular/cli
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)

enriqueRR avatar Jan 15 '23 05:01 enriqueRR

In my case, I had made a mess and needed to reinstall everything:

nvm uninstall 19
nvm uninstall 18
nvm uninstall 17
nvm install 17

Pikamander2 avatar Jan 30 '23 17:01 Pikamander2

I ran into this on EC2 with Amazon Linux 2. Amazon now include a note about using 16 vs. 18 on Amazon Linux 2:

https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html

Related: I really hope that Amazon is supporting nvm, given that they are recommending every EC2 node.js developer to use it!

Thanks for shouldering an enormous burden. Lots of love to nvm.

humphd avatar Jan 31 '23 16:01 humphd

I ran into this on EC2 with Amazon Linux 2. Amazon now include a note about using 16 vs. 18 on Amazon Linux 2:

An update on this, for anyone dealing with nvm + Amazon: Amazon Linux 2023 is now generally available, and I've just tested it with nvm and it supports node 18/19 well.

humphd avatar Mar 16 '23 17:03 humphd

Sounds like this can be closed, then.

ljharb avatar Mar 16 '23 17:03 ljharb

As an aside, it has nothing to do with the release of Amazon Linux 2023 (AL2023). Amazon Linux 2022 (AL2022) is already using glibc 2.34.

On AWS, this issue is caused by using glibc 2.26 on Amazon Linux 2. Amazon Linux 2 and AL2022 are different environments.

If you can't switch from Amazon Linux 2 to another operating system

Node.js v18 is Prebuilt binaries for Linux are now built on Red Hat Enterprise Linux (RHEL) 8 and are compatible with Linux distributions based on glibc 2.28 or later, for example, Debian 10, RHEL 8, Ubuntu 20.04.

Running Node.js with Docker (node:18-alpine) might solve your problem. https://hub.docker.com/_/node/

This variant is useful when final image size being as small as possible is your primary concern. The main caveat to note is that it does use musl libc instead of glibc and friends, so software will often run into issues depending on the depth of their libc requirements/assumptions.

CatsMiaow avatar Mar 17 '23 03:03 CatsMiaow

18.0.0 should work until the Ubuntu upgrade and >18.12.1 issue is resolved

dkowalec avatar Jul 01 '23 01:07 dkowalec

I run into the same problem with the glibc versions not found. It would be nice if they upgrade the Amazon LInux version so that it supports these libraries. The current image version is more than 2 years old now:

image

I tried to use a custom build image with AL2023, or public.ecr.aws/amazonlinux/amazonlinux:2023, but I get an error that git is not installed on the image:

/bin/sh: line 1: git: command not found

I don't understand why Amazon doesn't stick to their own minimum requirements when creating an image: https://docs.aws.amazon.com/amplify/latest/userguide/custom-build-image.html It needs to contains these 5 things and it obviously doesn't

em1l1000 avatar Oct 02 '23 09:10 em1l1000

The problem remains. And Angular 17 needs NodeJS 18.

rudyhadoux avatar Nov 13 '23 19:11 rudyhadoux

Does anyone know how to use a NodeJS 18 for AWS Amplify hosting here?

rudyhadoux avatar Nov 13 '23 20:11 rudyhadoux

@rudyhadoux and for anyone else running into this issue with AWS Amplify for Angular 17, I was able to resolve it by updating the Amplify build image settings.

Using sidenav, go to Build Settings tab > Build Image Settings section > Edit. You'll then have a few options for the build image. I selected Amazon Linux:2023 for the base image, and then created a package version override for Node 18.

Screenshot 2023-11-15 at 2 38 24 PM

nmatte avatar Nov 15 '23 22:11 nmatte

@nmatte thanks. I found an other way without changing anything. Just set in the pre-build : nvm use 18.

rudyhadoux avatar Nov 15 '23 23:11 rudyhadoux

Adding to this for anyone that runs into the issue in the future, trying to build a next version 14.0.1 project only worked for me by adding -nvm use 18 to the pre-build command. updating the version from build image settings still returns the same GLIBC_2.27 error.

Babszzz avatar Nov 18 '23 12:11 Babszzz

I think that nvm use 18 to the pre-build command is the best solution indeed.

rudyhadoux avatar Nov 18 '23 12:11 rudyhadoux

Sounds like you're using an older OS that doesn't have the appropriate C libraries node requires. You may find you can install node < 18 just fine.

If this is the case, it's about node's support of things and not nvm, and your only option is to upgrade your OS.

So what's your point is that the linux kernel version is too old to match the node v18, and the solution is either upgrade the OS kernel version or downgrade the node's version, right?

Flagami avatar Dec 26 '23 02:12 Flagami

@Flagami yes

ljharb avatar Dec 26 '23 07:12 ljharb

I just ran into this with an Angular project that I wanted to run in WSL Legacy 1.0 (because WSL 2 doesn't have file listeners). I can probably stick with Angular 16/Node 16 for now.

Fleker avatar Mar 13 '24 23:03 Fleker