Title
l

Lewis

06/11/2020, 5:34 PM
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

nikolasburk

06/11/2020, 5:37 PM
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

Lewis

06/11/2020, 5:38 PM
im pretty sure I have prisma 2
n

nikolasburk

06/11/2020, 5:39 PM
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

Lewis

06/11/2020, 5:40 PM
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

nikolasburk

06/11/2020, 5:41 PM
Which tutorial is it?
Did you try running the CLI with the
npx
prefix?
npx prisma generate
l

Lewis

06/11/2020, 5:45 PM
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

nikolasburk

06/11/2020, 5:45 PM
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:
npm uninstall -g prisma
Which tutorial are you following by the way?
l

Lewis

06/11/2020, 5:48 PM
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

nikolasburk

06/11/2020, 5:49 PM
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

Lewis

06/11/2020, 5:49 PM
➜ 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:
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