prisma generate ▸ Couldn’t find `prisma.yml` f...
# orm-help
l
prisma generate ▸ Couldn’t find
prisma.yml
file. Are you in the right directory? Get in touch if you need help: https://slack.prisma.io To get more detailed output, run $ export DEBUG="*" (node:42834) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
n
This looks like you're trying to use Prisma 1. Are you following some tutorial for the setup process or how do you currently use Prisma?
l
im pretty sure I have prisma 2
n
My hunch that you're using Prisma 1 is because it throws an error about
prisma.yml
which doesn't exist in Prisma 2 any more.
Can you share your
package.json
?
Also, are you currently following a tutorial or how are you using Prisma? 🙂
l
im following a tutorial
trying to use it at work in a production app! so a bit scary
"@prisma/client": "^2.0.0",
👍 1
"@prisma/cli": "^2.0.0",
👍 1
n
Which tutorial is it?
Did you try running the CLI with the
npx
prefix?
Copy code
npx prisma generate
l
interesting
prisma generate
➜ npx prisma generate Environment variables loaded from ./prisma/.env Error: You don't have defined any model in your schema.prisma, so nothing will be generated. You can define a model like this: model User { id Int @id @default(autoincrement()) email String @unique name String? } More information in our documentation: https://pris.ly/d/prisma-schema
behaves differently
n
Yes, that seems like the correct Prisma 2 CLI command
Maybe you have a global installation of the Prisma 1 CLI as
prisma
on your machine, you can remove that with:
Copy code
npm uninstall -g prisma
Which tutorial are you following by the way?
l
you were right! after going through that - I should expect one file to be updated right?
the schema file has added some gibberish I can't understand
tutorial: How to query your database using Prisma with NestJS - https://notiz.dev/blog/how-to-connect-nestjs-with-prisma#step-7-create-a-prisma-service
n
Also, the error you get now indicates that you need to define models in your Prisma schema. You can either define them manually and then migrate the DB using Prisma Migrate (which is not yet prod-ready though) or introspect an existing DB.
l
➜ npx prisma generate Environment variables loaded from ./prisma/.env ✔️ Generated Prisma Client to ./node_modules/@prisma/client in 159ms You can now start using Prisma Client in your code:
Copy code
import { PrismaClient } from '@prisma/client'
// or const { PrismaClient } = require('@prisma/client')

const prisma = new PrismaClient()
Explore the full API: http://pris.ly/d/client
🙌 1
thank you
🙌 1