Railway ignores RAILPACK_NODE_VERSION and package.json engines field
henrychris
HOBBYOP

2 months ago

After pushing a change to my Svelte + Bun project today, Railway's build failed while the same build succeeds locally with Node 22.18.0.

What happened:

  • Railway automatically installed Node 25.2.1 and the build failed

  • Locally with Node 22.18.0: build succeeds

  • Locally with Node 25.2.1: build fails (confirming it's a version issue)

What I tried:

  1. Set RAILPACK_NODE_VERSION=22.18.0 environment variable → build still failed

  2. Added "engines": { "node": "22.18.0" } to package.json → build still failed

  3. Added mise.toml file → build finally succeeded

Expected behavior:
Either the RAILPACK_NODE_VERSION environment variable or the engines.node field in package.json should have pinned the Node version to 22.18.0, but neither worked.

Workaround:
Using mise.toml works, but it seems like the other standard methods should have worked first.

1 Replies

henrychris
HOBBYOP

2 months ago

project id: ae360c46-b915-453f-bae1-b19230e7fdda


Loading...