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

/bin/sh: 1: zod-prisma: not found #19

Closed
kenneho opened this issue Nov 6, 2021 · 2 comments
Closed

/bin/sh: 1: zod-prisma: not found #19

kenneho opened this issue Nov 6, 2021 · 2 comments

Comments

@kenneho
Copy link

kenneho commented Nov 6, 2021

Hi. I'm trying to get this great library to work in a (Blitzjs with) Prisma project, but don't seem to get it installed properly.
Steps:

me@computer:~/project$ npm i --save-dev zod-prisma

added 10 packages, and audited 1714 packages in 12s

Add this to schema.prisma:

generator zod {
  provider      = "zod-prisma"
  output        = "./zod"
  relationModel = "default"
}

Run blitz prisma migrate dev, which results in this error:

Environment variables loaded from .env
Prisma schema loaded from db/schema.prisma
Datasource "db": SQLite database "db.sqlite" at "file:./db.sqlite"

Already in sync, no schema change or pending migration was found.

Running generate... (Use --skip-generate to skip the generators)
Error: Generator at zod-prisma could not start:

/bin/sh: 1: zod-prisma: not found

To me I loks like zod-prisma haven't been properly installed, and I suspect must have missed something in the documentation have yet to find exactly what. Do you have any suggestions as to how to debug this?
In the mean while I'm going for node_modules/zod-prisma/bin/cli.js as the provider.

@CarterGrimmeisen
Copy link
Owner

Hey there!

It looks like it was a configuration issue on my end that I didn't spot at first because of the version of yarn I was using. I've updated the bin entry in package.json to use the correct format, among some other small changes and published the update.

Thanks for pointing out the issue and let me know if this doesn't resolve the problem for you.

@kenneho
Copy link
Author

kenneho commented Nov 7, 2021

Thanks, I ran the updated version, and it works perfectly.

@kenneho kenneho closed this as completed Nov 7, 2021
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

2 participants