Railway ignore node version value
abeshunyah
HOBBYOP

a year ago

Issue

I cannot set the Node version that Svelte 5 needs.

I see the package.json can tell Railway what version they pick in this forum so i set:

package.json:

{
	"name": "myapp",
	"private": true,
	"version": "0.0.1",
	"type": "module",
	"engines": {
		"node": "20.19.0"
	}
}

Logs

Build fails with this log:

npm error code EBADENGINE
npm error engine Unsupported engine
npm error engine Not compatible with your version of node/npm: myapp
npm error notsup Not compatible with your version of node/npm: myapp
npm error notsup Required: {"node":"20.19.0"}
npm error notsup Actual:   {"npm":"10.8.2","node":"v20.18.1"}

Also another log after i set engines.node as "^20.18.1":

npm error code EBADENGINE
npm error engine Unsupported engine
npm error engine Not compatible with your version of node/npm: @sveltejs/vite-plugin-svelte@6.1.0
npm error notsup Not compatible with your version of node/npm: @sveltejs/vite-plugin-svelte@6.1.0
npm error notsup Required: {"node":"^20.19 || ^22.12 || >=24"}
npm error notsup Actual:   {"npm":"10.8.2","node":"v20.18.1"}

Any LLM could not solve this like 30 minutes battle...

And nothing changes if i set engines.node as "^20.19.0" or "24" or "^24" etc.. Railway always ignore these.

I know Docker works here but i am not familiar at all.

So tell me if I can without Docker.

Solved$10 Bounty

Pinned Solution

a year ago

Here’s how I fixed it—no Docker needed, just switch off Nixpacks and let Railpack respect the exact patch version:

  1. Flip the builder to Railpack In your Railway project → SettingsDeploymentBuilder, change from nixpacks to:
railpack  

Railpack will honor your engines.node setting; Nixpacks only ever uses the major version.

2. Pin the exact Node version in package.json

At the top level of package.json, add:

{ "engines": { "node": "20.19.0" } }  

(Or whatever exact patch Svelte 5 requires.)

3. Redeploy

Just hit Deploy (or push a dummy commit) and you’ll see Railpack installing Node v20.19.0 instead of falling back to v20.18.1

4 Replies

Railway
BOT

a year ago

Hey there! We've found the following might help you get unblocked faster:

If you find the answer from one of these, please let us know by solving the thread!


abeshunyah
HOBBYOP

a year ago

It is not resolved but Render.com follows package engines.node value and deploy successfully.

and they have mani options to do this.

like this:

https://render.com/docs/node-version

Pls Railway support this. maybe Railway reject minor version of node though i dont know why.


a year ago

Here’s how I fixed it—no Docker needed, just switch off Nixpacks and let Railpack respect the exact patch version:

  1. Flip the builder to Railpack In your Railway project → SettingsDeploymentBuilder, change from nixpacks to:
railpack  

Railpack will honor your engines.node setting; Nixpacks only ever uses the major version.

2. Pin the exact Node version in package.json

At the top level of package.json, add:

{ "engines": { "node": "20.19.0" } }  

(Or whatever exact patch Svelte 5 requires.)

3. Redeploy

Just hit Deploy (or push a dummy commit) and you’ll see Railpack installing Node v20.19.0 instead of falling back to v20.18.1


Status changed to Solved brody about 1 year ago


loganbek

Here’s how I fixed it—no Docker needed, just switch off Nixpacks and let Railpack respect the exact patch version: 1. **Flip the builder to Railpack** In your Railway project → **Settings** → **Deployment** → **Builder**, change from `nixpacks` to: ``` railpack ``` Railpack will honor your `engines.node` setting; Nixpacks only ever uses the **major** version. 2. **Pin the exact Node version in** `package.json` At the top level of `package.json`, add: ``` { "engines": { "node": "20.19.0" } } ``` (Or whatever exact patch Svelte 5 requires.) 3. **Redeploy** Just hit **Deploy** (or push a dummy commit) and you’ll see Railpack installing Node v20.19.0 instead of falling back to v20.18.1

abeshunyah
HOBBYOP

a year ago

It worked!

I did not know Railpack and it respect the exact patch version of Node.

Thank you so much.

how-to screenshot:

https://i.imgur.com/P0QNubo.png


Status changed to Awaiting Railway Response Railway about 1 year ago


Status changed to Solved brody about 1 year ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...