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 kysely not generating, Error: spawn prisma-kysely ENOENT #69

Open
Muhammad-Arsalan31 opened this issue Aug 22, 2023 · 8 comments
Labels
bug Something isn't working

Comments

@Muhammad-Arsalan31
Copy link

Muhammad-Arsalan31 commented Aug 22, 2023

Hi, I am having trouble generating types

this is my schema file I want to build both Prisma and Kysely types.

generator client {
  provider = "prisma-client-js"
}

generator kysely {
  provider = "prisma-kysely"

  // Optionally provide a destination directory for the generated file
  // and a filename of your choice
  output       = "../src/db"
  fileName     = "types.ts"
  // Optionally generate runtime enums to a separate file
  enumFileName = "enums.ts"
}

I am using Prisma 5 and prisma-kysely version 1.6

this is the error
image

what am I doing wrong?

@valtyr
Copy link
Owner

valtyr commented Aug 22, 2023

Huh this is interesting. This is likely related to #63. Might be related to you using Windows. I haven't done any testing on non-UNIX systems, and my assumption is that prisma-kysely is doing something wrong when it comes to paths. I'll fire up my Windows system soon and have a look. Thank you for reporting 🫡

@Muhammad-Arsalan31
Copy link
Author

Thanks, yes I am on Windows.

@dylel
Copy link
Contributor

dylel commented Aug 26, 2023

@Muhammad-Arsalan31 what database provider are you using? MySql?

@Muhammad-Arsalan31
Copy link
Author

Postgres

@dylel
Copy link
Contributor

dylel commented Sep 2, 2023

I've had this happen to me a few times when the module wasn't actually installed correctly for whatever reason, removing prisma-kysely, remove node modules, install node modules, install prisma-kysely. This generally fixes it for me

@Muhammad-Arsalan31
Copy link
Author

Hi, any updates on this issue?

@drew-marsh
Copy link

a global prisma-kysely install fixed this for me
npm i -g prisma-kysely

@MrSharpp
Copy link

found a fix for this issue,
this issue was arising due to importing of es6 module "string-width" into prisma-kysely dist files.
the quickest solution for me is to just remove all node_modules and then instead of using yarn i used pnpm and it installed correct peer dependency which somehow worked with prisma-kysely.

@valtyr valtyr added the bug Something isn't working label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants