Skip to content
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-dbml-generator not fund when using local package call #24

Open
ssukienn opened this issue Oct 25, 2021 · 2 comments
Open

prisma-dbml-generator not fund when using local package call #24

ssukienn opened this issue Oct 25, 2021 · 2 comments

Comments

@ssukienn
Copy link
Contributor

I am using husky to execute pre-commit script. I have there something like:

   ...
    ./node_modules/.bin/prisma generate <-- problem
    git add 'prisma/dbml/schema.dbml'

it is not working returning error:

Error: Generator at prisma-dbml-generator could not start:
/bin/sh: 1: prisma-dbml-generator: not found

Everything works fine using prisma generate from local project terminal or npx/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?

@luskin
Copy link

luskin commented Jul 11, 2023

We solved this by having separate generate calls, move the dbml generate out and use "prisma generate --generator client" in package.json instead.

@RioChndr
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants