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

Building with Node 18 #3796

Closed
2 tasks done
bergmorten opened this issue Nov 9, 2023 · 12 comments
Closed
2 tasks done

Building with Node 18 #3796

bergmorten opened this issue Nov 9, 2023 · 12 comments
Labels
archived This issue has been locked. pending-triage

Comments

@bergmorten
Copy link

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

node 18.x

Amplify CLI Version

12.7.1

What operating system are you using?

windows

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No

Describe the bug

I've build setting with latest amplify CLI and node 18, but this will not build when patching/setting amplify version...

image
2023-11-09T13:50:45.750Z [INFO]: SSM params {"Path":"/amplify/d3535s7bikhhjd/develop/","WithDecryption":true}
2023-11-09T13:51:09.159Z [INFO]: # Node version 18 is available for installation
2023-11-09T13:51:09.324Z [INFO]: # Installing Node version 18
2023-11-09T13:51:14.031Z [INFO]: # Now using Node version 18
2023-11-09T13:51:15.858Z [WARNING]: Cannot find module '/root/.nvm/versions/node//lib/node_modules/@aws-amplify/cli/package.json'
                                    Require stack:
                                    - /snapshot/AWSMobilePioneerExecute/out/index.js
2023-11-09T13:51:15.859Z [INFO]: # Patching NPM package '@aws-amplify/cli' to 12.8.2...
2023-11-09T13:51:16.418Z [INFO]: 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)
2023-11-09T13:51:16.418Z [ERROR]: !!! Error patching NPM package '@aws-amplify/cli' to version latest. Verify the package name and version are correct, and retry the build. For help see our docs: https://docs.aws.amazon.com/amplify/latest/userguide/custom-build-image.html

Changing back to Node 16, and then i works. Since newest LTS is version 20, node 18 should at least be supported?

Expected behavior

Should build when build setting is node 18 and amplify cli set to latest

Reproduction steps

Change build setting to node 18 and amplify to latest, then to new build or redeploy.

image

Project Identifier

No response

Log output

# Put your logs below this line
2023-11-09T13:50:45.750Z [INFO]: SSM params {"Path":"/amplify/d3535s7bikhhjd/develop/","WithDecryption":true}
2023-11-09T13:51:09.159Z [INFO]: # Node version 18 is available for installation
2023-11-09T13:51:09.324Z [INFO]: # Installing Node version 18
2023-11-09T13:51:14.031Z [INFO]: # Now using Node version 18
2023-11-09T13:51:15.858Z [WARNING]: Cannot find module '/root/.nvm/versions/node//lib/node_modules/@aws-amplify/cli/package.json'
                                    Require stack:
                                    - /snapshot/AWSMobilePioneerExecute/out/index.js
2023-11-09T13:51:15.859Z [INFO]: # Patching NPM package '@aws-amplify/cli' to 12.8.2...
2023-11-09T13:51:16.418Z [INFO]: 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)
2023-11-09T13:51:16.418Z [ERROR]: !!! Error patching NPM package '@aws-amplify/cli' to version latest. Verify the package name and version are correct, and retry the build. For help see our docs: https://docs.aws.amazon.com/amplify/latest/userguide/custom-build-image.html

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@bergmorten
Copy link
Author

Hmm I think the issue is that default build image is Linux2 (which is deprecated), newest is Linux 2023, which has the correct libc version....

@sobolk sobolk transferred this issue from aws-amplify/amplify-cli Nov 9, 2023
@josdejong
Copy link

Any workaround for this? Node 16 has reached EOL and is not receiving any security updates since 2 months, it's important to be able to upgrade to nodejs 18 or 20.

@josdejong
Copy link

I found a solution that works for my case (using a frontend only):

Go to Build settings -> Build image settings -> Edit. Select "Build image" instead of "Amaon Linux:2 (default)", enter "public.ecr.aws/docker/library/node:20.9.0", and clear the Live package updates (In my case there was one for "Nodejs version 16"):

afbeelding

@bergmorten
Copy link
Author

That would work :-)

I still think Amplify should change default image to Linux 2023 (which I think has support for both node 18 and 20). It seems that node 18 is the default node version inside amplify when creating lambda functions, so it is very strange that the build engine only has support for version 16 without specify a custom engine.

@bergmorten
Copy link
Author

Still waiting for them to fix correct environment name when deploying. Seems that there are few bug fixs and updates on this UI page?

@josdejong
Copy link

I still think Amplify should change default image to Linux 2023 (which I think has support for both node 18 and 20).

Definitely. Nodejs 16 is not a good default anymore, it's outdated and not maintained anymore 😅

@kachkaev
Copy link

Looks like Linux 2023 with Node 18 is available now (just not as a default): #3773 (comment)

@bergmorten
Copy link
Author

bergmorten commented Nov 20, 2023 via email

@josdejong
Copy link

Ah, yes, the Amazon Linux:2023 image works now!

@calavera
Copy link
Contributor

calavera commented Jan 4, 2024

Thanks for the comments! I'm closing this issue since the new AL 2023 image uses Node 18 by default.

@calavera calavera closed this as completed Jan 4, 2024
Copy link

github-actions bot commented Jan 4, 2024

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Copy link

github-actions bot commented Jan 4, 2024

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Jan 4, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jan 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. pending-triage
Projects
None yet
Development

No branches or pull requests

4 participants