Try installing the active LTS version instead of latest with nvm install 16 (instead of nvm install node) as per the examples.

This was tested on the docker image amazonlinux:2 and correlates to what AWS CDK supports (ref)

Update

LTS has moved on for node, however, as per @djvg's comment, note there is a limitation with amazon linux 2 on glibc, so if requiring node > 16 will need to move to newer amazon linux version, eg: https://github.com/amazonlinux/amazon-linux-2023/blob/main/Release-Notes-Amazon-Linux-2022.0.20220728.0.md

Answer from Efren on Stack Overflow
🌐
GitHub
github.com › nodejs › node › issues › 52241
Node.js is showing error "node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)" · Issue #52241 · nodejs/node
March 28, 2024 - check node --version cmd which is failing with error Error: node --version node: /lib64/libm.so.6: version GLIBC_2.27' 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 CXXABI_1.3.9' not found ...
Author   nodejs
Discussions

Node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node)
Hi, When attempting any kind of nodejs build with Travis, I get the following errors: node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node) node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by node) node: /lib/x86_64-linux-gn... More on travis-ci.community
🌐 travis-ci.community
1
0
March 1, 2023
Node.js 18 on Amazon Linux 2
Hello, I am having issues getting Node.js 18 to work on Amazon Linux 2. It seems like it installs fine but when I go to use it I am presented with the following error: ec2-user@server1:/home/ec2-... More on repost.aws
🌐 repost.aws
2
0
October 20, 2023
Install error `node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)`
bash -c "$(curl -fsSL ...========================== ℹ️ System: Linux 3.10.0-693.el7.x86_64 ℹ️ Shell: bash node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node) node: /lib64/libc.so.6: version `GLIBC_2.27' not found (required by node) node: ... More on github.com
🌐 github.com
1
April 6, 2026
RHEL 7.9 GLIBC Errors
Version v18.16.0 Platform Linux user@company.net 3.10.0-1160.80.1.el7.x86_64 #1 SMP Sat Oct 8 18:13:21 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux Subsystem No response What steps will reproduce the bu... More on github.com
🌐 github.com
3
June 13, 2023
🌐
Travis CI Community
travis-ci.community › languages › node.js
Node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node) - Node.js - Travis CI Community
March 1, 2023 - Hi, When attempting any kind of nodejs build with Travis, I get the following errors: node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node) node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by node) node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node) node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node) node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2....
Top answer
1 of 2
2
Multiple AWS service teams have compiled binaries for NodeJS v18.x for Amazon Linux 2 to use in their services. These service teams include ElasticBeanstalk and Cloud9. You can find references to these binaries in the CloudWatch logs related to ElasticBeanstalk and Cloud9 resources. While not officially supported by AWS, and only a specific version of NodeJS that has been compiled, you could borrow the NodeJS binary from the Cloud9 team and installon your Amazon Linux 2 based host. ``` ### download the NodeJS binary (x86 only) wget -nv https://d3rnber7ry90et.cloudfront.net/linux-x86_64/node-v18.17.1.tar.gz mkdir /usr/local/lib/node tar -xf node-v18.17.1.tar.gz mv node-v18.17.1 /usr/local/lib/node/nodejs ### Unload NVM, use the new node in the path, then install some items globally. echo "export NVM_DIR=''" >> /home/ec2-user/.bashrc echo "export NODEJS_HOME=/usr/local/lib/node/nodejs" >> /home/ec2-user/.bashrc echo "export PATH=\$NODEJS_HOME/bin:\$PATH" >> /home/ec2-user/.bashrc ### Reload environment . /home/ec2-user/.bashrc ### Verify NodeJS v18.x is operating node -e "console.log('Running Node.js ' + process.version)" ```
2 of 2
0
Hello. Unfortunately Amazon Linux2 does not support Nodejs18. If you want to use it on Amazon Linux2, you need to use Docker containers etc. I think you can use Amazon Linux 2023 as described in the document below. https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html https://repost.aws/questions/QUrXOioL46RcCnFGyELJWKLw/glibc-2-27-on-amazon-linux-2
🌐
GitHub
github.com › QwenLM › qwen-code › issues › 2926
Install error `node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)` · Issue #2926 · QwenLM/qwen-code
April 6, 2026 - Now using node v20.20.2 default -> 20 (-> v20.20.2) Now using node v20.20.2 ✅ Node.js v20 installed successfully 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) node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node) ℹ️ Node.js 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) node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by node) ℹ️ npm version:
Author   QwenLM
🌐
Tech Rescue
blog.nodejslab.com › how-to-solve-issues-when-installing-nodejs-18-15-0
How to solve issues when installing NodeJS 18.15.0
April 4, 2023 - It seems that the problem could be solved by updating GLIBC which makes more sense than downgrading the NodeJS version (as everyone says on the Internet). I found a link (listed below) with a very good analysis of the situation.
🌐
tutorialpedia
tutorialpedia.org › blog › installing-node-lib64-libm-so-6-version-glibc-2-27-not-found-required-by-node-error-on-linux
Fixing '/lib64/libm.so.6: version `GLIBC_2.27' not found' Error When Installing Node.js on Linux: Next Steps Guide — tutorialpedia.org
If you can’t upgrade your OS or GLIBC, the simplest fix is to use a Node.js version that works with your current GLIBC. First, confirm your system’s GLIBC version. Run: strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC_ | tail -n 1 # For Debian/Ubuntu # OR (for RHEL/CentOS) strings /lib64/libc.so.6 | grep GLIBC_ | tail -n 1
Find elsewhere
🌐
Bobby Hadz
bobbyhadz.com › blog › node-glibc-not-found-required-by-node
node: version `GLIBC_2.28` not found (required by node) | bobbyhadz
April 5, 2024 - The error "node: version GLIBC_2.28 not found (required by node)" occurs when the node binary you're trying to install was built on a GLIBC-2.27 or more recent system. To solve the error, install a Node.js version that is compatible with your ...
🌐
Frontendclub
frontendclub.net › aws-amplify-specified-node-18-but-GLIBC-not-found-on-build
AWS Amplify - Specified Node 18 but GLIBC_2.27 or GLIBC_2.28 not found on build - Frontend Club
January 6, 2023 - If you have to use Node.js 18 for your build (ie. Gatsby 5) on AWS Amplify, you may have seen the error GLIBC_2.27 not found. 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)
🌐
Letscodepare
letscodepare.com › blog › nvm-installed-getting-glibc-and-glibcxx-error-on-linux
NVM installed, Getting GLIBC and GLIBCXX Error on Linux | Let's Code Pare
Install the following rpm package, which include the GLIBCXX library after installed. wget -q https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/gcc-4.8.2-16.3.fc20/libstdc++-4.8.2-16.3.el6.x86_64.rpm wget -q https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/gcc-4.8.2-16.3.fc20/libstdc++-devel-4.8.2-16.3.el6.x86_64.rpm wget -q https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/epel-6-x86_64/gcc-4.8.2-16.3.fc20/libstdc++-static-4.8.2-16.3.el6.x86_64.rpm
🌐
GitHub
github.com › nodejs › node › issues › 48453
RHEL 7.9 GLIBC Errors · Issue #48453 · nodejs/node
June 13, 2023 - Now using node v18.16.0 (npm v) 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) $ node --version node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node) node: /l
Author   nodejs
🌐
GitHub
github.com › microsoft › playwright › issues › 31891
[Bug]: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /var/task/playwright/driver/node) · Issue #31891 · microsoft/playwright
July 28, 2024 - [Bug]: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by /var/task/playwright/driver/node)#31891
Author   microsoft
🌐
Nihaodanqing
nihaodanqing.com › linux › centos-7-node-v20-glibc_2_27.html
node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)解决方案 - linux - 你好丹青
cd /root/glibc-2.28/build ../configure --prefix=/usr --disable-profile --enable-add-ons --with-headers=/usr/include --with-binutils=/usr/bin make && make install · node -v 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)
🌐
GitHub
github.com › aws › aws-lambda-base-images › issues › 74
aws-lambda-nodejs /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node) · Issue #74 · aws/aws-lambda-base-images
January 4, 2023 - #8 32.90 npm notice #8 32.90 npm ERR! code 1 #8 32.90 npm ERR! path /var/task/node_modules/mongodb-memory-server #8 32.90 npm ERR! command failed #8 32.90 npm ERR! command sh -c -- node ./postinstall.js #8 32.90 npm ERR! node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node) #8 32.90 npm ERR!
Author   aws
🌐
Travis CI Community
travis-ci.community › deployment
Deployment Fails with node 20 - Deployment - Travis CI Community
March 21, 2024 - In an attempt to deploy to npm with Node 20 (which also happens to be the latest LTS version), I’m getting the following error message: t3.83s$ nvm install 20 node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' …
🌐
Ask Ubuntu
askubuntu.com › questions › 1403763 › node-js-is-installed-but-not-working
command line - Node.js is installed but not working - Ask Ubuntu
Now using node v18.0.0 (npm v) Creating default alias: default -> node (-> v18.0.0) $ node -v node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node) node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by node) node: /lib/x86_64-...
🌐
Medium
medium.com › @python-javascript-php-html-css › fixing-the-node-js-glibc-2-27-error-on-github-actions-upload-artifact-and-checkout-problems-cb5f76d3400b
Fixing the Node.js GLIBC_2.27 Error on GitHub Actions: Upload-Artifact and Checkout Problems | by Denis Bélanger 💎⚡✨ | Medium
October 30, 2024 - For more advanced control, the third script introduces a dynamic installation of the specific GLIBC version needed. By using an apt-get command to explicitly install libc6 with version 2.27, this solution is suitable for workflows that may require varied or changing dependencies over time.
🌐
GitHub
github.com › nvm-sh › nvm › issues › 3517
Not able to use multiple node version (16 and above except 17) on my EC2 instance · Issue #3517 · nvm-sh/nvm
January 29, 2025 - $ nvm --version 0.40.1 $ nvm list ... -> 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) ...
Author   nvm-sh