Deployment Failing - exit code 127 on npm run build with Prisma

denysomelchenko
FREE

24 days ago

Hello! I'm having trouble deploying a Node.js + Prisma application. My build fails consistently with exit code 127, which suggests the prisma command is not found during the build step, even though it is correctly configured.
What I've already tried:
Moved prisma from devDependencies to dependencies.

  • Using npx to call prisma commands (npx prisma generate...).

  • Using a postinstall script in package.json.

  • Using a nixpacks.toml file to explicitly define the build and start phases.

  • The current approach uses nixpacks.toml to call npm run build.
    Here is my current configuration:
    [phases.install]

    cmds = ["npm install"]

    [phases.build]

    cmds = ["npm run build"]

    [start]

    cmd = "npm start"
    package.json scripts section:
    "scripts": {

    "start": "node src/app.js",

    "build": "npx prisma generate && npx prisma migrate deploy",

    "dev": "nodemon src/app.js",

    "test": "jest"

    },
    The build fails on the npm run build step with exit code 127. It seems like the binaries in node_modules are not available to the shell during the build phase.

0 Replies

Deployment Failing - exit code 127 on npm run build with Prisma - Railway Help Station