Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lexavey opened this issue Dec 12, 2022 · 25 comments
Closed
Labels
installing node Issues with installing node/io.js versions. needs followup We need some info or action from whoever filed this issue/PR.

Comments

@lexavey
Copy link

lexavey commented Dec 12, 2022

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?

@ljharb
Copy link
Member

ljharb commented Dec 12, 2022

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 ljharb added the installing node Issues with installing node/io.js versions. label Dec 12, 2022
@teachdugsimt
Copy link

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

@ljharb
Copy link
Member

ljharb commented Dec 22, 2022

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

@ljharb ljharb added the needs followup We need some info or action from whoever filed this issue/PR. label Dec 22, 2022
@Meandmybadself
Copy link

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

@teachdugsimt
Copy link

@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

@ljharb
Copy link
Member

ljharb commented Dec 23, 2022

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

@johnnytomcat
Copy link

I had to downgrade to node 16.16 for aws amplify

@ljharb
Copy link
Member

ljharb commented Jan 10, 2023

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

@enriqueRR
Copy link

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)

@Pikamander2
Copy link

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

@humphd
Copy link

humphd commented Jan 31, 2023

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
Copy link

humphd commented Mar 16, 2023

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.

@ljharb
Copy link
Member

ljharb commented Mar 16, 2023

Sounds like this can be closed, then.

@ljharb ljharb closed this as completed Mar 16, 2023
@CatsMiaow
Copy link

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.

@dkowalec
Copy link

dkowalec commented Jul 1, 2023

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

@em1l1000
Copy link

em1l1000 commented Oct 2, 2023

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

@rudyhadoux
Copy link

The problem remains.
And Angular 17 needs NodeJS 18.

@rudyhadoux
Copy link

rudyhadoux commented Nov 13, 2023

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

@nmatte
Copy link

nmatte commented Nov 15, 2023

@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

@rudyhadoux
Copy link

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

@Babszzz
Copy link

Babszzz commented Nov 18, 2023

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.

@rudyhadoux
Copy link

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

@Flagami
Copy link

Flagami commented Dec 26, 2023

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?

@ljharb
Copy link
Member

ljharb commented Dec 26, 2023

@Flagami yes

@Fleker
Copy link

Fleker commented Mar 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
installing node Issues with installing node/io.js versions. needs followup We need some info or action from whoever filed this issue/PR.
Projects
None yet
Development

No branches or pull requests