a month ago
My Next.js 16 application is failing to build on Railway because the platform is using Node.js 18.20.4 instead of the required Node.js version >=20.9.0.
**Error Message:**
```
$ bun run next build
You are using Node.js 18.20.4. For Next.js, Node.js version ">=20.9.0" is required.
error: "next" exited with code 1
```
**What I've Already Configured:**
1. ✅ Added `engines` field to `package.json`:
```json
"engines": {
"node": ">=20.9.0"
}
```3 Replies
a month ago
Hey there! We've found the following might help you get unblocked faster:
🧵 You are using Node.js 18.20.4. For Next.js, Node.js version ">=20.9.0" is required.
🧵 Container starts successfully but is immediately stopped with no error
If you find the answer from one of these, please let us know by solving the thread!
a month ago
Hello!
That's a bit odd, using engines with the specified version should work. Could you share your entire package.json file? Do you have any other package.json files in your application? I'm wondering if that might be causing the issue or overriding what you're setting. Can you try adding an environment variable to your service to see if that makes a difference?
RAILPACK_NODE_VERSION=20
Once that is done redeploy to see if that solves the issue.
a month ago
Hey, another user had a similar issue with Bun and Next.js 16 and solved it by adding the line below to their package.json file.
"packageManager": "bun@1.3.1^"