Skip to content

Instantly share code, notes, and snippets.

@joesoeph
Created April 21, 2024 03:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joesoeph/24695f2c3653bf2690e1257eec09292c to your computer and use it in GitHub Desktop.
Save joesoeph/24695f2c3653bf2690e1257eec09292c to your computer and use it in GitHub Desktop.
PrismaClient Not Found When Using PNPM

PrismaClient Not Found When Using PNPM

After setup prisma using PNPM in your project by following this official prisma setup. You getting error by import PrismaClient like below:

image

Before jump to the solution, this is my schema.prisma config file:

image

This problem happen because after run pnpm exec prisma generate, file node_modules/.prisma/client not generated. For my suggestion solution, you need to adding schema.prisma with additional output configuration like below:

image

After adding that, run pnpm exec prisma generate again. And Ta-Da, your problem have been solved!

If you look at the node_module folder, you can see .prisma folder generated successful!

Hope this solution help you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment