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

Not able to use multiple node version (16 and above except 17) on my EC2 instance #3517

Open
ShivamS136 opened this issue Jan 29, 2025 · 1 comment

Comments

@ShivamS136
Copy link

Operating system and version:

[ec2-user@ip ~]$ cat /etc/os-release
NAME="Amazon Linux"
VERSION="2"
ID="amzn"
ID_LIKE="centos rhel fedora"
VERSION_ID="2"
PRETTY_NAME="Amazon Linux 2"
ANSI_COLOR="0;33"
CPE_NAME="cpe:2.3:o:amazon:amazon_linux:2"
HOME_URL="https://amazonlinux.com/"

nvm debug output:

nvm --version: v0.40.1
$SHELL: /bin/bash
$SHLVL: 1
whoami: 'ec2-user'
${HOME}: /home/ec2-user
${NVM_DIR}: '${HOME}/.nvm'
${PATH}: ${NVM_DIR}/versions/node/v18.20.6/bin:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/local/sbin:/usr/sbin:${HOME}/.local/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-koji-linux-gnu)'
uname -a: 'Linux 5.10.149-133.644.amzn2.x86_64 #1 SMP Tue Oct 18 16:52:42 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux'
checksum binary: 'sha256sum'
OS version: Amazon Linux 2
awk: /bin/awk, GNU Awk 4.0.2
curl: /bin/curl, curl 8.3.0 (x86_64-koji-linux-gnu) libcurl/8.3.0 OpenSSL/1.0.2k-fips zlib/1.2.7 libidn2/2.3.0 libpsl/0.21.5 (+libidn2/2.3.0) libssh2/1.4.3 nghttp2/1.41.0 OpenLDAP/2.4.44
wget: /bin/wget, GNU Wget 1.14 built on linux-gnu.
git: /bin/git, git version 2.40.1
ls: cannot access alias
/bin/grep: No such file or directory
grep: alias grep='grep --color=auto'
	/bin/grep (grep --color=auto), grep (GNU grep) 2.20
sed: /bin/sed, sed (GNU sed) 4.2.2
cut: /bin/cut, cut (GNU coreutils) 8.22
basename: /bin/basename, basename (GNU coreutils) 8.22
rm: /bin/rm, rm (GNU coreutils) 8.22
mkdir: /bin/mkdir, mkdir (GNU coreutils) 8.22
xargs: /bin/xargs, xargs (GNU findutils) 4.5.11
nvm current: none
which node: ${NVM_DIR}/versions/node/v18.20.6/bin/node
which iojs: which: no iojs in (${NVM_DIR}/versions/node/v18.20.6/bin:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/local/sbin:/usr/sbin:${HOME}/.local/bin:${HOME}/bin)
which npm: ${NVM_DIR}/versions/node/v18.20.6/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.28' 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.28' not found (required by node)

nvm ls output:

        v13.8.0
       v14.17.3
       v18.20.6
default -> 14.17.3 (-> v14.17.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.20.6) (default)
stable -> 18.20 (-> v18.20.6) (default)
lts/* -> lts/jod (-> N/A)
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.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.20.6
lts/iron -> v20.18.2 (-> N/A)
lts/jod -> v22.13.1 (-> N/A)

How did you install nvm?

Got it pre-installed on the box from my org but I updated via install script in readme

What steps did you perform?

  1. Just installed node 18 and used

What happened?

Not able to use node for version 16 and above (except 17)

What did you expect to happen?

Use Node without any issue

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

No

Related logs

Logs for node working for v14 but not for v18

$ nvm --version
0.40.1

$ nvm list
        v13.8.0
->     v14.17.3
       v18.20.6
default -> 14.17.3 (-> v14.17.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.20.6) (default)
stable -> 18.20 (-> v18.20.6) (default)
lts/* -> lts/jod (-> N/A)
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.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.20.6
lts/iron -> v20.18.2 (-> N/A)
lts/jod -> v22.13.1 (-> N/A)

$ nvm current
v14.17.3

$ nvm use 18
Now using node v18.20.6

$ nvm list
        v13.8.0
       v14.17.3
       v18.20.6
default -> 14.17.3 (-> v14.17.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.20.6) (default)
stable -> 18.20 (-> v18.20.6) (default)
lts/* -> lts/jod (-> N/A)
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.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.20.6
lts/iron -> v20.18.2 (-> N/A)
lts/jod -> v22.13.1 (-> N/A)

$ nvm current
none

$ node --version
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)

$ npm --version
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)

$ nvm use 13
Now using node v13.8.0 (npm v6.13.6)

$ nvm current
v13.8.0

$ node --version
v13.8.0

$ nvm use 14
Now using node v14.17.3 (npm v6.14.13)

$ node --version
v14.17.3

$ nvm use 18
Now using node v18.20.6

$ node --version
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)

$ which node
~/.nvm/versions/node/v18.20.6/bin/node

$ nvm_tree_contains_path ${NVM_DIR} $(command which node) ; echo $?
0

$ nvm use 14
Now using node v14.17.3 (npm v6.14.13)

$ which node
~/.nvm/versions/node/v14.17.3/bin/node

$ nvm_tree_contains_path ${NVM_DIR} $(command which node) ; echo $?
0

Logs for checking 16 and above versions

$ nvm install 20
Downloading and installing node v20.18.2...
Downloading https://nodejs.org/dist/v20.18.2/node-v20.18.2-linux-x64.tar.xz...
############################################################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v20.18.2

$ nvm ls
        v13.8.0
       v14.17.3
       v18.20.6
       v20.18.2
default -> 14.17.3 (-> v14.17.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v20.18.2) (default)
stable -> 20.18 (-> v20.18.2) (default)
lts/* -> lts/jod (-> N/A)
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.3 (-> N/A)
lts/gallium -> v16.20.2 (-> N/A)
lts/hydrogen -> v18.20.6
lts/iron -> v20.18.2
lts/jod -> v22.13.1 (-> N/A)

$ nvm install 16
Downloading and installing node v16.20.2...
Downloading https://nodejs.org/dist/v16.20.2/node-v16.20.2-linux-x64.tar.xz...
############################################################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v16.20.2 (npm v8.19.4)

$ nvm ls
        v13.8.0
       v14.17.3
->     v16.20.2
       v18.20.6
       v20.18.2
default -> 14.17.3 (-> v14.17.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v20.18.2) (default)
stable -> 20.18 (-> v20.18.2) (default)
lts/* -> lts/jod (-> N/A)
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.3 (-> N/A)
lts/gallium -> v16.20.2
lts/hydrogen -> v18.20.6
lts/iron -> v20.18.2
lts/jod -> v22.13.1 (-> N/A)

$ nvm install 15
Downloading and installing node v15.14.0...
Downloading https://nodejs.org/dist/v15.14.0/node-v15.14.0-linux-x64.tar.xz...
############################################################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v15.14.0 (npm v7.7.6)

$ nvm ls
        v13.8.0
       v14.17.3
->     v15.14.0
       v16.20.2
       v18.20.6
       v20.18.2
default -> 14.17.3 (-> v14.17.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v20.18.2) (default)
stable -> 20.18 (-> v20.18.2) (default)
lts/* -> lts/jod (-> N/A)
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.3 (-> N/A)
lts/gallium -> v16.20.2
lts/hydrogen -> v18.20.6
lts/iron -> v20.18.2
lts/jod -> v22.13.1 (-> N/A)

$ nvm install 17
Downloading and installing node v17.9.1...
Downloading https://nodejs.org/dist/v17.9.1/node-v17.9.1-linux-x64.tar.xz...
############################################################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v17.9.1 (npm v8.11.0)

$ nvm ls
        v13.8.0
       v14.17.3
       v15.14.0
       v16.20.2
->      v17.9.1
       v18.20.6
       v20.18.2
default -> 14.17.3 (-> v14.17.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v20.18.2) (default)
stable -> 20.18 (-> v20.18.2) (default)
lts/* -> lts/jod (-> N/A)
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.3 (-> N/A)
lts/gallium -> v16.20.2
lts/hydrogen -> v18.20.6
lts/iron -> v20.18.2
lts/jod -> v22.13.1 (-> N/A)

$ nvm install 21
Downloading and installing node v21.7.3...
Downloading https://nodejs.org/dist/v21.7.3/node-v21.7.3-linux-x64.tar.xz...
############################################################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v21.7.3

$ nvm ls
        v13.8.0
       v14.17.3
       v15.14.0
       v16.20.2
        v17.9.1
       v18.20.6
       v20.18.2
        v21.7.3
default -> 14.17.3 (-> v14.17.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v21.7.3) (default)
stable -> 21.7 (-> v21.7.3) (default)
lts/* -> lts/jod (-> N/A)
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.3 (-> N/A)
lts/gallium -> v16.20.2
lts/hydrogen -> v18.20.6
lts/iron -> v20.18.2
lts/jod -> v22.13.1 (-> N/A)

$ nvm install 23
Downloading and installing node v23.6.1...
Downloading https://nodejs.org/dist/v23.6.1/node-v23.6.1-linux-x64.tar.xz...
############################################################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v23.6.1

$ nvm ls
        v13.8.0
       v14.17.3
       v15.14.0
       v16.20.2
        v17.9.1
       v18.20.6
       v20.18.2
        v21.7.3
        v23.6.1
default -> 14.17.3 (-> v14.17.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v23.6.1) (default)
stable -> 23.6 (-> v23.6.1) (default)
nlts/* -> lts/jod (-> N/A)
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.3 (-> N/A)
lts/gallium -> v16.20.2
lts/hydrogen -> v18.20.6
lts/iron -> v20.18.2
lts/jod -> v22.13.1 (-> N/A)

$ nvm install 22
Downloading and installing node v22.13.1...
Downloading https://nodejs.org/dist/v22.13.1/node-v22.13.1-linux-x64.tar.xz...
############################################################################################################################################################################################################### 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v22.13.1

$ nvm ls
        v13.8.0
       v14.17.3
       v15.14.0
       v16.20.2
        v17.9.1
       v18.20.6
       v20.18.2
        v21.7.3
       v22.13.1
        v23.6.1
default -> 14.17.3 (-> v14.17.3)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v23.6.1) (default)
stable -> 23.6 (-> v23.6.1) (default)
lts/* -> lts/jod (-> v22.13.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.3 (-> N/A)
lts/gallium -> v16.20.2
lts/hydrogen -> v18.20.6
lts/iron -> v20.18.2
lts/jod -> v22.13.1
@ljharb
Copy link
Member

ljharb commented Jan 29, 2025

This seems like it might be the issue:

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)

https://repost.aws/questions/QUvkkhY--uTiSDkS6R1jFnZQ/node-js-18-on-amazon-linux-2 suggests that node 18+ isn 't supported, and that you have to use a docker container. (in other words, this has nothing to do with nvm; this is an Amazon Linux problem)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants