- Newest
- Most votes
- Most comments
Take this:
- Check the Build Environment
Add this to your amplify.yml file under the build phase:
version: 1
frontend:
phases:
preBuild:
commands:
- node -v
- npm -v
build:
commands:
- yarn build
artifacts:
baseDirectory: .next
files:
- '**/*'
cache:
paths:
- node_modules/**/*
This will print the Node.js version used during the build in your Amplify Console logs.
- Set a Specific Node.js Version
preBuild:
commands:
- nvm install 20
- nvm use 20
- node -v
You can also specify the Node version in your package.json:
"engines": {
"node": ">=20.0.0"
}
This helps Amplify detect your preferred runtime and may trigger warnings if incompatible.
To identify the Node.js version being used for your Amplify app with Next.js SSR, you have a few options:
For the build process:
- You can specify the Node.js version in your amplify.yml configuration file using the
nodeVersionsetting. For example:
settings:
nodeVersion: "18"
- If you haven't explicitly set a Node.js version, you can check your build logs for any indication of which version is being used during the build process.
For the SSR runtime:
-
For Next.js SSR applications on Amplify, you can specify the Node.js version in your amplify.yml file, which will be used for both build and runtime environments.
-
You can also add a simple API route to your Next.js application that returns
process.versionto display the Node.js version being used at runtime.
To update your Node.js version:
- Update the
nodeVersionsetting in your amplify.yml file to a supported version (Node.js 20+). - Alternatively, you can use the
enginesfield in your package.json file to specify the Node.js version requirements for your application.
Given AWS's announcement about ending support for Node.js 14, 16, and 18 after September 15, 2025, it's recommended to upgrade to Node.js 20+ before that date to ensure your application continues to work properly and receives security updates.
Sources
Announcing the end of support for Node.js 14.x and 16.x in AWS CDK | AWS DevOps & Developer Productivity Blog
my amplify deploy app problem | AWS re:Post
Configuring your application's dependencies on Elastic Beanstalk - AWS Elastic Beanstalk
IAM Compute Roles for Server-Side Rendering with AWS Amplify Hosting | Front-End Web & Mobile
answered a year ago
Relevant content
asked 2 years ago
- AWS OFFICIALUpdated 4 years ago
- AWS OFFICIALUpdated 5 years ago
- AWS OFFICIALUpdated 10 months ago
