BlogPrisma

sh: prisma: not found How to fix it.

The build ran Prisma and could not find it. Add prisma to package.json at the same version as @prisma/client.

How the Agent API works
What you see
> postinstall
> prisma generate

sh: 1: prisma: not found
  • What it meansThe prisma command is missing
  • The fixAdd prisma at your client's version
  • Common causeIt is only in devDependencies
  • On AntideployIt pins the version for the build

What it means

Your build runs prisma generate, often in a postinstall or build script. The prisma command is not installed. If it is in devDependencies, a production install skips it. If it is not in package.json at all, npx fetches whatever version is newest, which may not match your @prisma/client.

How to fix it

  1. Add prisma at the same version as @prisma/client

    Use matching versions, for example both ^6.0.0. Mismatched versions cause errors of their own.

  2. Move it to dependencies if a production install skips it

    If prisma is in devDependencies and the build says it is missing, list it under dependencies instead.

  3. Commit package.json and the lock file, then deploy again

    A failed deploy never counts against your plan.

package.json
{
  "dependencies": {
    "@prisma/client": "^6.0.0",
    "prisma": "^6.0.0"
  }
}

What Antideploy does

Antideploy recognises this failure. It pins the prisma command to the version of your @prisma/client in its own copy of your source for the build, and tells you it did. It never edits your repository, so make the fix in your own package.json too.

01Questions

Prisma questions, answered.

Anything else? Write to us and a person answers.

support@antideploy.com
Why does it work locally?

Locally, npm install installs development packages, and npx may find a copy already downloaded.

Do I also need prisma migrate deploy in a script?

No. Antideploy detects Prisma and runs npx prisma migrate deploy if you have a migrations folder, and npx prisma db push if you do not, before the new version goes live.

Does this failed deploy cost anything?

No. Failed deploys never count against your plan.

Deploy something. Start with one sentence.

Paste one sentence into your coding agent, click Approve once, and get a live link. No card, no trial clock.

Start from GitHub or a folder
Prompt copied Paste it into Claude Code, Codex or Cursor and press Enter.