-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prisma generate
fails when using pnpm workspaces because it tries to install prisma dependencies with npm or yarn
#5340
Comments
Actually I just got past the issue by just manual installing @prisma/client in my local project. I ran: |
Looks like we always use npm to install the client package if it is missing. Workaround should suffice here for now but we should recheck this assumption in code. |
This is still reproducible, we should add a special case for pnpm |
prisma migrate dev
fails when using pnpm workspacesprisma generate
fails when using pnpm workspaces
@keyworks could you confirm this issue is fixed using these versions of prisma? I personally tested in a couple projects and everything seems to work correctly now
|
(BTW if the context is of interest I described this fix in my article-series exploring TS monorepo patterns: https://dev.to/jonlauridsen/attempt-3-build-the-source-4oa3) |
We are experiencing the same issue using yarn 2, even when using 2.27.0-integration-fix-sdk-pnpm.2 |
prisma generate
fails when using pnpm workspacesprisma generate
fails when using pnpm workspaces because it tries to install prisma dependencies with npm or yarn
I think what's happening here is that when your project doesn't have Current workaround:
We need to add pnpm support here: |
Actually we are using the exact same setup as before - on 2.23.0, everything has been working just fine, on 2.29.0, we are getting the npm-error. We use prisma within a workspace of a yarn2-monorepo. our new dependencies look like this:
|
@v-morlock It would be good to open a seperate issue for Yarn 2 since it might be a different, but maybe related problem. |
Wouldn't work in some cases, f.e. in rushjs monorepo lock files are kept in a separate subdirectory. Probably better way would be to explicitly state used package manager (f.e. For now manually installing |
This isn't monorepo specific, just pnpm. I have just walked through the Quickstart with pnpm in a clean directory and encountered this. I don't mind (would rather) install dependencies manually but it isn't mentioned anywhere on that page (though it does indicate ts-node). Installing |
Is there a specific version I can install to avoid this currently? I don't want to move away from pnpm monorepo at the moment. |
We are going to prioritize this issue in the coming weeks. For now, the workaround is to manually add |
Adding @prisma/client to the root repo's dependencies did solve the issue. Thanks much! |
Hey folks, we have just improved our |
Bug description
prisma migrate dev
appears to be running npm to install@prisma/cli
but it fails since my project is a pnpm project.How to reproduce
workspace:
protocol in package.json (see https://pnpm.js.org/en/workspaces)pnpx prisma migrate dev --name init --preview-feature
I get the following error:
Expected behavior
No error
Environment & setup
The text was updated successfully, but these errors were encountered: