Install completely broken with `yarn pnpify`
Bug description
Your "generate" command is trying to force me to put prisma as a dev dependency. That is wrong, it is a dependency. Nevertheless, it doesn't work. If you move it to dev dependencies, you get an inverse/circular error telling you to change it back to a regular dependency.
How to reproduce
Just yarn add prisma and run yarn prisma generate:
β git:(main) β yarn prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Usage Error: Package "prisma" is already listed as a regular dependency - remove the -D,-P flags or remove it from your dependencies first
$ yarn add [--json] [-E,--exact] [-T,--tilde] [-C,--caret] [-D,--dev] [-P,--peer] [-O,--optional] [--prefer-dev] [-i,--interactive] [--cached] [--mode #0] ...
Error: Command failed with exit code 1: yarn add -D [email protected]
Error: Could not resolve @prisma/client despite the installation that we just tried.
Please try to install it by hand with yarn add @prisma/client and rerun yarn prisma generate π.
β git:(main) β yarn remove prisma
β git:(main) β yarn add -D prisma
β git:(main) β yarn prisma generate
Error: Could not resolve @prisma/client despite the installation that we just tried.
Please try to install it by hand with yarn add @prisma/client and rerun yarn prisma generate π.
Expected behavior
Generate the client, do not mess with me dependencies
Prisma information
n/a
Environment & setup
- OS: macOS,
- Database: n/a
- Node.js version: 18.14.1
Prisma Version
4.10.1
By the way, if it is your claim I'm using an unsupported setup or it's a duplicate "yarn issue" or something, I would in turn ask you why your error message is so unhelpful.
Yep, of course switching from pnp to node-modules fixed it, but I am using pnpify and custom prisma output locations in other projects. Because of this issue, I cannot replicate my previously working setup, even w/ the same versions of prisma, yarn, etc. :/
Eventually I solved it - had to run yarn pnpify prisma generate instead of yarn prisma generate.
Perhaps this issue could be renamed "please add documentation for pnpify workarounds" or "improve error messages when users try to use pnp in unsupported manner"
Eventually I solved it - had to run
yarn pnpify prisma generateinstead ofyarn prisma generate.
This worked for me! Except I had to install pnpify first with yarn add @yarnpkg/pnpify. I'm using yarn 3.5.0.
Related: https://github.com/prisma/prisma/issues/8765#issuecomment-1854451597
Hey everyone π thanks a lot for the lively discussion in this issue! After reading through everything, I believe that the main issue here stemmed from the usage of PnPify which seems to be deprecated now.
Hence, I'll close this issue since we're not documenting workarounds for deprecated tooling. If you still think that we should update our docs, please feel free to re-open the issue with specific information about what kind of updates you'd like to see π
I do not think I have the ability to reopen the issue. I would contend that the main issue stems from the fact you have re-implemented the module resolution instead of using the languageβs built in module resolution. Accordingly, I still think it would make sense to document what you were doing that is non-standard, and why. Just because one tool that this created conflicts with is now technically deprecated doesnβt mean people still arenβt using that deprecated tool for various reasons or may run into issues with your non-standard approach, even if they were using different tooling.