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

Astro build failing due to mismatched node version. #3754

Closed
4 tasks done
xkeshav opened this issue Oct 7, 2023 · 10 comments
Closed
4 tasks done

Astro build failing due to mismatched node version. #3754

xkeshav opened this issue Oct 7, 2023 · 10 comments
Assignees
Labels
archived This issue has been locked. frontend-builds question Further information is requested

Comments

@xkeshav
Copy link

xkeshav commented Oct 7, 2023

Before creating a new issue, please confirm:

On which framework/platform are you having an issue?

Other

Which UI component?

Other

How is your app built?

Astro

What browsers are you seeing the problem on?

Chrome

Which region are you seeing the problem in?

us-east-1

Please describe your bug.

I have blog and it is hosted on a domain and AWS amplify trigger the build as soon as I commit and it was working fine till last commit

in last commit, I have updated Astro version and now build is getting failed and reason is. Although I have checked in GitHub workflow, it shows different error of CSS parsing issue in Jekyll build ; mentioned here.

but in AWS amplify build log, it says wrong node js version, this is the log details.

                                 # Starting phase: preBuild
                                 # Executing command: npm ci
2023-10-06T19:20:02.795Z [WARNING]: npm
2023-10-06T19:20:02.797Z [WARNING]: WARN EBADENGINE Unsupported engine {
                                    npm WARN EBADENGINE   package: '@astrojs/[email protected]',
                                    npm WARN EBADENGINE   required: { node: '>=18.14.1' },
                                    npm WARN EBADENGINE   current: { node: 'v16.19.0', npm: '8.19.3' }
                                    npm WARN EBADENGINE }
                                    npm WARN EBADENGINE Unsupported engine {
                                    npm WARN EBADENGINE   package: '@astrojs/[email protected]',
                                    npm WARN EBADENGINE   required: { node: '>=18.14.1' },
                                    npm WARN EBADENGINE   current: { node: 'v16.19.0', npm: '8.19.3' }
                                    npm WARN EBADENGINE }
2023-10-06T19:20:02.798Z [WARNING]: npm
2023-10-06T19:20:02.798Z [WARNING]: WARN EBADENGINE Unsupported engine {
                                    npm WARN EBADENGINE   package: '[email protected]',
                                    npm WARN EBADENGINE   required: { node: '>=18.14.1', npm: '>=6.14.0' },
                                    npm WARN EBADENGINE   current: { node: 'v16.19.0', npm: '8.19.3' }
                                    npm WARN EBADENGINE }
2023-10-06T19:20:15.722Z [INFO]: added 576 packages, and audited 577 packages in 16s
2023-10-06T19:20:15.726Z [INFO]: 227 packages are looking for funding
                                 run `npm fund` for details
2023-10-06T19:20:15.742Z [INFO]: 4 vulnerabilities (3 low, 1 moderate)
                                 To address issues that do not require attention, run:
                                 npm audit fix
                                 To address all issues (including breaking changes), run:
                                 npm audit fix --force
                                 Run `npm audit` for details.
2023-10-06T19:20:15.756Z [INFO]: # Completed phase: preBuild
                                 # Starting phase: build
2023-10-06T19:20:15.756Z [INFO]: # Executing command: npm run build
2023-10-06T19:20:16.116Z [INFO]: > [email protected] build
                                 > astro build
2023-10-06T19:20:16.234Z [WARNING]: Node.js v16.19.0 is not supported by Astro!
                                    Please upgrade Node.js to a supported version: ">=18.14.1"
2023-10-06T19:20:16.236Z [INFO]: AWS CodeBuild CI Environment Detected!
                                 Additional steps may be needed to set your Node.js version:
2023-10-06T19:20:16.237Z [INFO]: Documentation: https://docs.astro.build/guides/deploy
2023-10-06T19:20:16.244Z [ERROR]: !!! Build failed
2023-10-06T19:20:16.245Z [ERROR]: !!! Non-Zero Exit Code detected
2023-10-06T19:20:16.245Z [INFO]: # Starting environment caching...
2023-10-06T19:20:16.245Z [INFO]: # Uploading environment cache artifact...
2023-10-06T19:20:16.357Z [INFO]: # Uploaded environment cache artifact
2023-10-06T19:20:16.358Z [INFO]: # Environment caching completed
Terminating logging...

build link: https://us-east-1.console.aws.amazon.com/amplify/home?region=us-east-1#/d1c6hzkoiamnhy/develop/15

now kindly help me how to upgrade node js version to this AWS Amplify app?

thsi is my package json

{
  "name": "grateful-galaxy",
  "type": "module",
  "version": "0.0.1",
  "scripts": {
    "dev": "astro dev",
    "start": "astro dev",
    "build": "astro build",
    "preview": "astro preview",
    "astro": "astro"
  },
  "dependencies": {
    "@astrojs/mdx": "^0.17.2",
    "@astrojs/rss": "^2.1.1",
    "@astrojs/sitemap": "^1.1.0",
    "astro": "^3.2.0"
  },
  "devDependencies": {
    "typescript": "^5.2.2"
  }
}

note: local build command run successfully.

Thanks

What's the expected behaviour?

Build should run and complete successfully.

Help us reproduce the bug!

created a separate branch so you can trigger the build again here is the latest build result for the same: https://us-east-1.console.aws.amazon.com/amplify/home?region=us-east-1#/d1c6hzkoiamnhy/update/1?step=BUILD

Code Snippet

// Put your code below this line.

Console log output

No response

Additional information and screenshots

image

No response

@xkeshav xkeshav changed the title Astro build failing due to mismtached node version Astro build failing due to mismatched node version. Oct 7, 2023
@xkeshav
Copy link
Author

xkeshav commented Oct 7, 2023

Update: I have updated the node JS version using Build Settings --> Build image settings to 18.14.1

image

and retriggered the build but now it is failing with another reason.

: 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)
# Starting phase: preBuild
2023-10-07T18:15:08.707Z [INFO]: # Executing command: npm ci
2023-10-07T18:15:08.708Z [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)
2023-10-07T18:15:08.709Z [ERROR]: !!! Build failed
2023-10-07T18:15:08.709Z [ERROR]: !!! Non-Zero Exit Code detected
2023-10-07T18:15:08.709Z [INFO]: # Starting environment caching...
2023-10-07T18:15:08.709Z [INFO]: # Environment caching completed
Terminating logging...

@reesscot reesscot transferred this issue from aws-amplify/amplify-ui Oct 9, 2023
@reesscot
Copy link

reesscot commented Oct 9, 2023

@xkeshav Moving ticket over the to the Amplify Hosting repo, since this is a Amplify hosting build issue.

@Jay2113 Jay2113 self-assigned this Oct 9, 2023
@Jay2113
Copy link
Contributor

Jay2113 commented Oct 9, 2023

Hi @xkeshav 👋 , thanks for raising this!

Please refer to my comment here: #3571 (comment)

@Jay2113 Jay2113 added frontend-builds question Further information is requested response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed pending-triage labels Oct 9, 2023
@xkeshav
Copy link
Author

xkeshav commented Oct 11, 2023

I have tried whatever mentioen in the comment #3571 but Astro doesnt support less than 18.4.0 . :(

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Oct 11, 2023
@BraedenKilburn
Copy link

For those still having issues, in my "Build Settings", I set my "Build image" to be a custom image from Docker's public ECR. This is the image that I used public.ecr.aws/docker/library/node:20; however, you may choose to use your own image, a list of which may be found here.

@evokelabs
Copy link

This is still an issue with my latest astro builds. Using the default astro install with 'npm create astro@latest' and connecting amplify with the github repository will have this node mismatch error without @BraedenKilburn fix.

@JuanCa8313
Copy link

I was searching for a couple of hours, and I found a solution to that problem. All I did was change the image to Amazon Linux:2023.

image

@xkeshav
Copy link
Author

xkeshav commented Dec 18, 2023

this worked

I was searching for a couple of hours, and I found a solution to that problem. All I did was change the image to Amazon Linux:2023.

image

this worked

@xkeshav xkeshav closed this as completed Dec 18, 2023
Copy link

⚠️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

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Dec 18, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 18, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. frontend-builds question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants