Open ssukienn opened 3 years ago
We solved this by having separate generate calls, move the dbml
generate out and use "prisma generate --generator client"
in package.json instead.
I found this problem too. I agree with @luskin, separate the process generate calls. here is my package.json
:
"scripts": {
"prisma:generate": "npx prisma generate --generator client",
"prisma:generate:all": "npx prisma generate",
}
by default run npm run prisma:generate
will generate the client only, in my case I run inside the docker. And run npm run prisma:generate:all
to generate all generator (include dbml)
Reference : Prisma cli generator
I am using husky to execute pre-commit script. I have there something like:
it is not working returning error:
Everything works fine using
prisma generate
from local project terminal ornpx/yarn prisma generate
in husky script but not with explicit package call. I suspect there is some problem with PATH and my intention here is to let the husky script be package manager agnostic by using preinstalled binaries whether it is yarn or npm etc.Could you direct me on how to make it work or maybe is there something you could do to make prisma binary be aware of your generator so it can call it directly?