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: ...
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
POSTCSS error: `GLIBC_2.27' not found (required by node)
Hi all, I'm trying to deploy our docs to Amazon. I use the latest Node LTS. Getting this error as of today: POSTCSS: failed to transform "scss/main.css" (text/css): node: /lib/x86_64-... More on github.com
🌐 github.com
3
October 27, 2022
node.js - Getting GLIBC_2.28 not found - Stack Overflow
Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... AI agents are a confused deputy with the keys to your... You don’t understand DNS like you think you... ... 53 NodeJs Error - Failed to load gRPC binary module because it was not installed for the current system Expected directory? ... 27 Installing node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required ... More on stackoverflow.com
🌐 stackoverflow.com
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
🌐
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 - I remember a similar workaround when troubleshooting Node dependencies in a legacy project, where using an older environment was the quickest solution to push critical updates. 😅 · 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.
🌐
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....
🌐
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-...
🌐
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 - By default AWS Amplify uses Amazon Linux:2 as its build image and it comes with GLIBC 2.26. However, building frontend apps that require Node.js 18 will require GLIBC 2.27 or 2.28. You can either (1) set a node image for the specific version you plan to use or (2) select image Amazon Linux:2023.
🌐
codestudy
codestudy.net › blog › glibc-2-27-not-found-while-installing-node-on-amazon-ec2-instance
Resolving GLIBC_2.27 and GLIBC_2.28 Not Found Errors When Installing Node.js on Amazon Linux EC2 Instance — codestudy.net
You’ve spun up an Amazon Linux ... issue is more common than you might think, and it boils down to a compatibility mismatch between newer Node.js versions and the GNU C Library (GLIBC) preinstalled on Amazon ...
🌐
GitHub
github.com › google › docsy › issues › 1296
POSTCSS error: `GLIBC_2.27' not found (required by node) · Issue #1296 · google/docsy
October 27, 2022 - Hi all, I'm trying to deploy our docs to Amazon. I use the latest Node LTS. Getting this error as of today: POSTCSS: failed to transform "scss/main.css" (text/css): node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (r...
Author   google
Find elsewhere
🌐
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 - bash -c "$(curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh)" -s --source qwenchat ========================================== Qwen Code Installation Script ========================================== ℹ️ 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: /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
Author   QwenLM
🌐
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
🌐
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.
🌐
Miya-Gadget
miyagadget.page › home › pc › how to fix “glibc_2.28 not found” error with node.js 20 on ubuntu 16.04
How to Fix “GLIBC_2.28 not found” Error with Node.js 20 on Ubuntu 16.04 - Miya-Gadget
March 6, 2026 - Because the system was missing the GLIBC versions required by the Node.js binary, even a simple “node -v” command wouldn’t work.
🌐
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' …
🌐
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
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