K
Kysely14mo ago
tzezar

cant use kysely-codegen

I followed this part https://kysely.dev/docs/getting-started of documentation till CODEGEN part when you can generate types based on actual database. https://kysely.dev/docs/generating-types this one. I installed needed packages: npm install --save-dev kysely-codegen, and I set database string in .env file. Next step is: kysely-codegen, but I get this error when I type it in the console:
kysely-codegen
kysely-codegen : The term 'kysely-codegen' is not recognized as the name of a cmdlet, function, script file, o
r operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
+ kysely-codegen
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (kysely-codegen:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
kysely-codegen
kysely-codegen : The term 'kysely-codegen' is not recognized as the name of a cmdlet, function, script file, o
r operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
+ kysely-codegen
+ ~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (kysely-codegen:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
any help please?
Generating types | Kysely
To work with Kysely, you're required to provide a database schema type definition to the Kysely constructor.
Solution:
oh I feel stupid... npx kysely-codegen works
Jump to solution
2 Replies
Solution
tzezar
tzezar14mo ago
oh I feel stupid... npx kysely-codegen works
Igal
Igal14mo ago
Hey 👋🏻 Add a script that invokes kysely-codegen to your package.json and run that script.
Want results from more Discord servers?
Add your server