graphql-nexus / nexus-prisma

Prisma plugin for Nexus
https://graphql-nexus.github.io/nexus-prisma
MIT License
561 stars 46 forks source link

Yarn PNP Compatibility #191

Open SagnikPradhan opened 2 years ago

SagnikPradhan commented 2 years ago

Screenshot

image

Description

Prisma seemed to be stuck on generate command, running it with DEBUG="*" showed it had to do with floggy not mentioning chalk as a (peer, I assume) dependency.

Repro Steps/Link

I presume any project using yarn 2+ instead of npm and running yarn pnpify prisma generate

SagnikPradhan commented 2 years ago

Edit - Do this instead https://github.com/prisma/nexus-prisma/issues/191#issuecomment-1098401592

Temporary solution would be using node_modules linker instead with yarn config use nodeLinker node-modules (followed by yarn install OFC)

janpio commented 2 years ago

Workaround if you are hitting this with pnpm: https://github.com/prisma/prisma/issues/10291#issuecomment-1095767034

SagnikPradhan commented 2 years ago

Aaah, right, forgot about this issue. You could do similar with yarn pnp too, using package extensions and declaring chalk (4.x) as a dependency of floggy.

GrassHopper42 commented 2 years ago

I resolved this problem.

I just added chalk: ^4.1.2 to floggy dependency in yarn.lock