prisma generate 🟩 Node.js

Error: @prisma/client did not initialize yet. Please run "prisma generate"

The generated Prisma Client is missing or out of date.

Seen on: Node.js

Meaning

Prisma Client is generated from schema.prisma. Fresh installs, CI builds and Docker images need prisma generate (usually via postinstall).

Common causes

  • prisma generate not run after install
  • Docker build copying node_modules without generation
  • Schema changed without regenerating

⚡ Quick fix

  1. npx prisma generate
  2. Add "postinstall": "prisma generate"
  3. Run generate in the Dockerfile after copying the schema

Detailed fix by platform

Docker

  1. bash
    COPY prisma ./prisma
    RUN npm ci && npx prisma generate

How to diagnose

  1. Generated — node_modules/.prisma/client exists?
  2. Build — Is generate part of CI/Docker?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.