Build keeps failing
rohitbkamat
HOBBYOP

2 months ago

Keep running into a failed build - error from the build log says:

sh scripts/railway-build-api.sh

821ms

rm: cannot remove 'packages/ui/node_modules/.vite': Device or resource busy

Build Failed: build daemon returned an error < failed to solve: process "sh -c sh scripts/railway-build-api.sh" did not complete successfully: exit code: 1 >

Solved$10 Bounty

2 Replies

Status changed to Open Railway about 2 months ago


parashdev
HOBBY

2 months ago

same

stage-0

RUN npm run build

834ms

> server@1.0.0 build

> tsc -p .

sh: 1: tsc: not found

Build Failed: build daemon returned an error < failed to solve: process "/bin/bash -ol pipefail -c npm run build" did not complete successfully: exit code: 127 >

was working fine 20 mins agao


Status changed to Solved rohitbkamat about 2 months ago


rohitbkamat
HOBBYOP

2 months ago

I used the agent to help me resolve the issue.

The problem is that Railpack's automatic install phase runs npm ci before your script, and that's where the EBUSY error happens.

The fix:

  1. Added an installCommand to railway.json that explicitly tells Railpack to use /tmp for npm's cache
  2. Updated the build script to skip its own npm ci since Railpack's install phase now handles it
  3. This ensures npm never tries to clean up /app/node_modules/.cache

Status changed to Awaiting Railway Response Railway about 2 months ago


Status changed to Solved sam-a about 2 months ago


Welcome!

Sign in to your Railway account to join the conversation.

Loading...