nixpacks.toml install phase override not being applied (npm ci still runs despite [phases.install] = npm install)
hnbutler003-byte
HOBBYOP

7 days ago

Hi all, hoping someone can help or a Railway team member can take a look.

The issue: My nixpacks.toml at the repo root defines:

[phases.setup]

nixPkgs = ["nodejs_20"]

[phases.install]

cmds = ["npm install"]

The build log confirms the setup phase is correctly picked up (shows nodejs_20 instead of the old nodejs_18), but the install phase still runs npm ci instead of my configured npm install. I've confirmed:

The file is correctly pushed and live on the GitHub repo connected to this service (verified via direct SHA comparison between local and remote)

There is no .nixpacks/ directory committed in the repo

There is no Install Command override set in the service's Settings → Build tab (only Build Command and Start Command fields exist there, both empty/default)

Why this matters: npm ci is crashing partway through install with npm error Exit handler never called!, a known npm-internal bug, which then causes the build step to fail with tsx: not found since the install never completed. Switching to npm install was meant to work around this npm bug, but the override isn't being honored.

Additional clue: the build log shows inconsistent Docker stage numbering within the same single build, some lines show [stage-0 2/8] and others show [stage-0 3/15]. This made me suspect a stale cached build plan is being partially reused instead of fully regenerated from the current nixpacks.toml.

What I've tried: confirmed no repo-level conflicts, confirmed no dashboard override exists, triggered multiple fresh deploys, all show the same npm ci behavior despite the file change.

Is there a way to force-invalidate a cached Nixpacks build plan for a service?

Solved$10 Bounty

Pinned Solution

You can set env variable NO_CACHE=1 to disable build cache, also I think some peoples said that nixpack is no longer supported and should use railpack instead, so I'm not sure if nixpack will still working

1 Replies

Railway
BOT

7 days ago

This thread has been opened as a bounty so the community can help solve it.

Status changed to Open Railway 7 days ago


You can set env variable NO_CACHE=1 to disable build cache, also I think some peoples said that nixpack is no longer supported and should use railpack instead, so I'm not sure if nixpack will still working


Status changed to Solved hnbutler003-byte 7 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...