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
🌐
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)
Discussions

astrojs - Astro v 3 require Node js 18 and AWS amplify fail to build due to version `GLIBC_2.27' not found (required by node) - Stack Overflow
I have Astro v3 and trying to build using AWS amplify but it does not build and fail with below detail, updated build setting to node js v 18.14.1 but when build it gives error # Starting phase: pr... More on stackoverflow.com
🌐 stackoverflow.com
node.js - Installing node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node) error on linux - Stack Overflow
I have followed this - How to install node.tar.xz file in linux in the end while doing node --version I am getting these errors - What should be done next here?, not able to find proper steps with More on stackoverflow.com
🌐 stackoverflow.com
Node.js is showing error "node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by node)"
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 ... More on github.com
🌐 github.com
23
March 28, 2024
Astro build failing due to mismatched node version.
Before creating a new issue, please confirm: I have searched for duplicate or closed issues and discussions. I have tried disabling all browser extensions or using a different browser I have tried ... More on github.com
🌐 github.com
10
October 7, 2023
🌐
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
🌐
GitHub
github.com › aws-amplify › amplify-hosting › issues › 3754
Astro build failing due to mismatched node version. · Issue #3754 · aws-amplify/amplify-hosting
October 7, 2023 - but in AWS amplify build log, it says wrong node js version, this is the log details.
Author   aws-amplify
Find elsewhere
🌐
Saturn Cloud
saturncloud.io › blog › how-to-solve-the-glibc227-not-found-error-while-installing-node-on-amazon-ec2-instance
Saturn Cloud | Saturn Cloud | The Control Plane for GPU Clouds
June 19, 2023 - Saturn Cloud is the white-labeled control plane for GPU clouds: multi-tenant isolation, day-2 support, and integrated billing, running in your cloud under your brand.
🌐
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-gn...
🌐
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 ...
🌐
GitHub
github.com › aws-amplify › amplify-hosting › issues › 3109
Fix support for node 18 · Issue #3109 · aws-amplify/amplify-hosting
November 15, 2022 - 2022-11-15T19:19:02.924Z [WARNING]: 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   aws-amplify
🌐
Opalstack Community
community.opalstack.com › d › 1076-unable-to-install-node-18121-lts
Unable to install Node 18.12.1 (LTS) - Opalstack Community Forum
December 25, 2022 - Discussion for Opalstack web and email hosting, the managed hosting service for developers and businesses like yours!
🌐
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
🌐
Medium
medium.com › @anarmammadli › npm-node-error-on-cpanel-f267511831be
Npm(Node) error on Cpanel - Anar Mammadli - Medium
February 4, 2024 - 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)
🌐
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
🌐
DEV Community
dev.to › abbazs › how-to-fix-issue-node-libx8664-linux-gnulibcso6-version-glibc228-not-found-required-by-node-3chb
How to fix issue "node: /lib/x86_64-linux-gnu/libc.so.6: version 'GLIBC_2.28' not found (required by node)"? - DEV Community
July 7, 2023 - Node.js has a dependency on a specific GLIBC version (in this case, version 2.28 or higher), and if the system's GLIBC version is older, it will result in this error.