# sh: prisma: not found How to fix it.

URL: https://antideploy.com/blog/prisma-generate-command-not-found

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

**What you see**

```
> postinstall
> prisma generate

sh: 1: prisma: not found
```

## At a glance

- **What it means**: The prisma command is missing
- **The fix**: Add prisma at your client's version
- **Common cause**: It is only in devDependencies
- **On Antideploy**: It pins the version for the build

Published 7 October 2026. Facts checked 7 October 2026. 1 min read.

## 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.

## Prisma questions, answered.

Anything else? Write to us and a person answers.

[support@antideploy.com](mailto: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.

## More guides, and the platform.

Each platform page covers one part of Antideploy: what it does, where it stops and the questions people ask. [See the whole platform](https://antideploy.com/platform), or [all the guides](https://antideploy.com/blog).

- [Prisma Environment variable not found](https://antideploy.com/blog/prisma-environment-variable-not-found): Prisma needed a variable and it was not set. DATABASE_URL is set for you when your app has a database.
- [Prisma 7 datasource url is no longer supported](https://antideploy.com/blog/prisma-7-datasource-url-no-longer-supported): Prisma 7 removed the url field. Pin Prisma to version 6, or move the connection into prisma.config.ts.
- [How to add a Postgres database to your app](https://antideploy.com/blog/how-to-add-a-postgres-database-to-your-app): Ask your agent. A Postgres 17 database is created beside your app and DATABASE_URL is set.

- [Deployments](https://antideploy.com/platform/deployments)
- [Database](https://antideploy.com/platform/database)
- [Logs and monitoring](https://antideploy.com/platform/logs-and-monitoring)

Facts on this page were checked against the live platform on 7 October 2026.

## 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.

To set this up, give your coding agent this sentence:

```text
Set this project up to deploy on Antideploy. Fetch https://antideploy.com/agent.md and follow it.
```
