jethiya007
jethiya007

Reputation: 57

Could not resolve @prisma/client despite the installation that we just tried

I have a turbo repo setup and this is a problem which comes on its own and go on its own, till now i was only experiencing this in local setup but now i am also experiencing it in prod.

getting this error:

Error: Could not resolve @prisma/client despite the installation that we just tried.
Please try to install it by hand with npm i @prisma/client and rerun npx "prisma generate" 🙏.

tried all the ways listed on github issues and discussions but none work, they did worked in the past but not now. I am using

The problem i have noticed is this mostly occurs in monorepo setup and same case here the .prisam and @prisma/client files which should lie in root node_modules is instead in the packages/db

Upvotes: 1

Views: 357

Answers (1)

Nikhil Sharma
Nikhil Sharma

Reputation: 11

Check your package.json file if you have prisma/client only as a dependency then you will face this error , you need to also add it into your devDependencies and then it will start working. This happens because when working with turborepo or monorepo dependencies are often hoisted and your package manager may explicitly want to know where exactly is the prisma/client . Hope this solves your issue.

Upvotes: 1

Related Questions