Railpack build fails with npm not found, even on redeploy of a working build
lacd89
HOBBYOP

19 days ago

Service: cita2go-backend (project cita2go, environment production)

Every deployment on this service has failed during the build step since 2026-09-16 ~15:51 CST, always with: sh: 1: npm: not found

Railpack's plan skips the Node install step entirely. The build log shows a warning "Script start.sh not found" and the Steps section only lists build (npm run build), with no install/Node provisioning step.

I also clicked Redeploy on the deployment that had been ACTIVE and running successfully for 7 days, same exact source, no code changes, and it failed identically. That strongly points to an issue in Railway's build infrastructure (Railpack/Metal builder) for this service rather than in our repo.

Build command: npm run build

Start command: npm run start:prod

Builder: Railpack (default)

Build log excerpt (deployment id e80a90cd):

using build driver railpack-v0.39.0

prepare railpack-v0.39.0

Railpack 0.39.0

Warning: Script start.sh not found

Steps: build - npm run build

Deploy: npm run start:prod

load build definition from ./railpack-plan.json

copy . cached

npm run build

sh: 1: npm: not found

Build Failed: build daemon returned an error less than failed to solve: process sh -c npm run build did not complete successfully: exit code: 127 greater than

I tried 7+ deploy attempts (CLI railway up and dashboard Redeploy) over about 40 minutes, all with the identical failure. Production is currently unaffected, still serving the previous successful deployment, so there is no outage, just an inability to ship new deployments on this service.

Could someone take a look at why Railpack is not provisioning Node for this service anymore?

Solved$10 Bounty

3 Replies

Status changed to Awaiting Railway Response Railway • 19 days ago


Railway
BOT

19 days ago

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

Status changed to Open Railway • 19 days ago


19 days ago

Railpack gives you warning about start.sh not found, its probably failed to read the code at snapshot stage and Redeploy won't help since it is using the same snapshot across redeploy

Railpack analyze code to determine which language you're using so I assume npm command not found because it is failed to analyze the code

Try open the Command Palette (Ctrl+K) on your service and select Deploy Latest Commit, This should re-fetch your code


lacd89
HOBBYOP

18 days ago

Thanks for the tip. This service isn't connected to GitHub (deploys via CLI railway up), so Command Palette doesn't offer Deploy Latest Commit for it, only an agent chat option.

I tried the CLI equivalent of forcing a fresh snapshot: bumped package.json version (so the uploaded content hash changes) and ran railway up again. Same failure, identical error (sh: 1: npm: not found, Steps only lists build, no install step). So it doesn't look like plain content-hash caching, something server-side for this service seems stuck.

Production is unaffected, verified api.cita2go.com is still serving from the old successful deployment. Any other way to force Railway to re-analyze the service from scratch for a CLI-deployed non-GitHub service?


lacd89
HOBBYOP

18 days ago

Found the actual root cause, it was on our side, not a Railway builder bug. Our global CLI config (~/.railway/config.json) had this service linked with projectPath pointing at the monorepo root (backend, frontend and brand as siblings), not at the backend/ subdirectory itself. So railway up was uploading the whole monorepo root every time, and Railpack correctly could not detect a single language/app at that root, hence the start.sh warning and missing npm.

Fix: ran railway link again from inside backend/ specifically, which created a separate, correctly scoped entry for that exact subdirectory. After that, railway up built and deployed successfully right away.

Created a fresh service with the fix in place, verified it healthy, moved the api.cita2go.com domain over, and removed the old stuck service. Everything is back up. Thanks for the snapshot/analyze pointer, that is what got me looking in the right place.


Status changed to Solved lacd89 • 18 days ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...