Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using NodeJS 18 in AWS Amplify on Amazon Linux 2 fails

Trying to upgrade an existing React app running on AWS Amplify from node v16 to v18
The image used is the provided Amazon Linux 2

Expected it to install node 18 on the machine it spun up and build the application, since this is the LTS version

Here is the error I get in the build process:

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)
like image 533
Sahar LaOr Avatar asked May 27 '26 21:05

Sahar LaOr


2 Answers

As of April 2023, per this comment:

Node 18 available in the default Docker image for all builds! The version is pinned to 18.13.0, which you can leverage by simply adding the nvm use 18 command to your build spec.

version: 1
backend:
  phases:
    build:
      commands:
        - nvm use 18
        - amplifyPush --simple
like image 102
C RICH Avatar answered May 30 '26 11:05

C RICH


The same problem happened to me, I fixed it by adding a custom image in the build config.

You can see the steps to add a custom image in the following link

The image that worked for me was the following:

public.ecr.aws/t7o4u3y2/node-18.2.0:latest

UPDATE

Now is available support Node 18.x

Please see the update here

like image 41
Deivy Hernández Avatar answered May 30 '26 09:05

Deivy Hernández



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!