That's what I did in package.json file (It was a deploy a Next app on Versel) I just added generate command to the build script:

"scripts": {
    "dev": "next dev",
    "build": "prisma generate && next build",
    "start": "next start",
    "lint": "next lint"
  },

Not sure if it is a correct way, though..

Answer from maxuapro on Stack Overflow
🌐
Prisma
prisma.io › home › introduction to prisma client › introduction to prisma client › introduction to prisma client › introduction to prisma client
Introduction to Prisma Client | Prisma Documentation
npm · bunx prisma generate · This will create a generated directory based on where you set the output to in the Prisma Schema. Any time your import Prisma Client, it will need to come from this generated client API.
🌐
npm
npmjs.com › package › prisma
prisma - npm
2 days ago - npm · Sign UpSign In · 7.9.0 • Public • Published 16 hours ago · Readme · Code Beta · 6 Dependencies · 1030 Dependents · 9,205 Versions · Quickstart • Website • Docs • Examples • Blog • Discord • Twitter · Prisma is a next-generation ORM that consists of these tools: Prisma Client: Auto-generated and type-safe query builder for Node.js & TypeScript ·
      » npm install prisma
    
Published   Jul 20, 2026
Version   7.9.0
🌐
Prisma
prisma.io › home › generating prisma client › generating prisma client › generating prisma client › generating prisma client
Generating Prisma Client | Prisma Documentation
generator client { provider = "prisma-client" output = "./generated" } Run the following command whenever you add models, change fields, or update generator settings: bun · pnpm · yarn · npm · bunx prisma generate · If you want the CLI-specific options such as --watch or --generator, see the prisma generate command reference.
🌐
npm
npmjs.com › package › prisma-erd-generator
prisma-erd-generator - npm
May 30, 2026 - npm tokens that bypass 2FA are being restricted — account changes (Aug 2026) and direct publishing (Jan 2027). Learn how to prepare →× ... Prisma generator to create an ER Diagram every time you generate your prisma client.
      » npm install prisma-erd-generator
    
Published   Jul 13, 2026
Version   2.4.4
🌐
Prisma
prisma.io › home › generators › generators › generators › generators
Generators (Reference) | Prisma Documentation
The default generator for Prisma Client is prisma-client, which outputs plain TypeScript code and requires a custom output path (read more about it here). Alternatively, you can configure any npm package that complies with our generator ...
🌐
npm
npmjs.com › package › prisma-class-generator
prisma-class-generator - npm
August 12, 2024 - Latest version: 0.2.11, last published: 2 years ago. Start using prisma-class-generator in your project by running `npm i prisma-class-generator`. There are 5 other projects in the npm registry using prisma-class-generator.
      » npm install prisma-class-generator
    
Published   Aug 12, 2024
Version   0.2.11
Find elsewhere
🌐
npm
npmjs.com › package › prisma-docs-generator
prisma-docs-generator - npm
May 17, 2023 - Latest version: 0.8.0, last published: 3 years ago. Start using prisma-docs-generator in your project by running `npm i prisma-docs-generator`. There are 1 other projects in the npm registry using prisma-docs-generator.
      » npm install prisma-docs-generator
    
Published   May 17, 2023
Version   0.8.0
🌐
npm
npmjs.com › package › prisma-zod-generator
prisma-zod-generator - npm
# Install npm install -D prisma-zod-generator # Add to schema.prisma generator zod { provider = "prisma-zod-generator" } # Generate npx prisma generate
      » npm install prisma-zod-generator
    
Published   Feb 14, 2026
Version   2.1.4
🌐
GitHub
github.com › prisma › prisma
GitHub - prisma/prisma: Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB · GitHub
Once the data model is defined, you can generate Prisma Client which will expose CRUD and more queries for the defined models. If you're using TypeScript, you'll get full type-safety for all queries (even when only retrieving the subsets of ...
Starred by 47.4K users
Forked by 2.4K users
Languages   TypeScript 99.0% | JavaScript 0.9% | Shell 0.1% | Dockerfile 0.0% | PLpgSQL 0.0% | Batchfile 0.0%
🌐
npm
npmjs.com › package › @mainamiru › prisma-types-generator
@mainamiru/prisma-types-generator - npm
March 29, 2025 - Start using @mainamiru/prisma-types-generator in your project by running `npm i @mainamiru/prisma-types-generator`. There are no other projects in the npm registry using @mainamiru/prisma-types-generator.
      » npm install @mainamiru/prisma-types-generator
    
Published   Mar 29, 2025
Version   1.1.14
🌐
Prisma
prisma.io › home › postgresql › postgresql › postgresql
Quickstart: Prisma ORM with PostgreSQL (10 min) | Prisma Documentation
Now run the following command to generate the Prisma Client: bun · pnpm · yarn · npm · bunx prisma generate · Now that you have all the dependencies installed, you can instantiate Prisma Client.
🌐
egghead.io
egghead.io › lessons › prisma-install-and-set-up-prisma-for-a-new-project
Install and Set up Prisma for a New Project | egghead.io
[2:28] Now we can generate the prisma client based on our data model with npx prisma generate. The generated code will live inside the node_modules directory. Later, we can simply import and use the Prisma database Client tailored to the data ...
🌐
DEV Community
dev.to › ashsajal › dont-write-npx-prisma-generate-command-42i6
Don't write npx prisma generate command - DEV Community
June 27, 2024 - New Prisma Packages: Run it after installing new Prisma packages. ... Make your life even easier by automating this command with build tools like npm run build or yarn build. This ensures your generated code is always up-to-date.
🌐
npm
npmjs.com › package › prisma-dbml-generator
prisma-dbml-generator - npm
February 15, 2024 - Prisma DBML Generator. Latest version: 0.12.0, last published: 2 years ago. Start using prisma-dbml-generator in your project by running `npm i prisma-dbml-generator`. There are 6 other projects in the npm registry using prisma-dbml-generator.
      » npm install prisma-dbml-generator
    
Published   Feb 15, 2024
Version   0.12.0
🌐
Prisma
prisma.io › home › generate › generate
prisma generate | Generate Prisma Client & Artifacts | Prisma Documentation
Multiple generators: bun · pnpm · yarn · npm · bunx prisma generate --generator client --generator zod_schemas · The prisma-client generator creates a customized client for working with your database.
🌐
npm
npmjs.com › package › @prisma › client
@prisma/client - npm
Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.. Latest version: 7.9.0, last published: 14 hours ago. Start using @prisma/client in your project by running `npm ...
      » npm install @prisma/client
    
Published   Jul 20, 2026
Version   7.9.0
🌐
Prisma
prisma.io › home › prisma cli reference › prisma cli reference › prisma cli reference
Prisma CLI reference | Prisma Documentation
For general debugging - CI: - DEBUG: ... in Prisma ORM v7) - PRISMA_SCHEMA_ENGINE_BINARY: - PRISMA_MIGRATION_ENGINE_BINARY: For the "postinstall" npm hook - PRISMA_GENERATE_SKIP_AUTOINSTALL: (Not supported in Prisma ORM v7) - PRISMA_SKIP_POSTINSTALL_GENERATE: (Not supported in Prisma ...
🌐
GitHub
github.com › YassinEldeeb › create-prisma-generator
GitHub - YassinEldeeb/create-prisma-generator: Get started developing your own ◭ Prisma generator by running a single command.
Workspace setup for testing the generator locally using prisma generate. Scripts for development, building, packaging and testing. Support for most package-managers yarn, pnpm and npm.
Starred by 195 users
Forked by 8 users
Languages   TypeScript 84.3% | JavaScript 15.2% | Shell 0.5% | TypeScript 84.3% | JavaScript 15.2% | Shell 0.5%