Hi! I'm trying to gradually upgrade from Prisma 1 ...
# orm-help
d
Hi! I'm trying to gradually upgrade from Prisma 1 to 2 but I'm facing this error: → npx prisma init Error: We detected a Prisma 1 project. For Prisma 1, please use the
prisma1
CLI instead. You can install it with
npm install -g prisma1
. If you want to upgrade to Prisma 2+, please have a look at our upgrade guide: http://pris.ly/d/upgrading-to-prisma2 at this step: https://www.prisma.io/docs/guides/upgrade-guides/upgrade-from-prisma-1/upgrading-the-prisma-layer-mysql#2-create-your-prisma-2-schema
n
Hey Daniell 👋 Welcome to our Slack community!
Did you install Prisma 2 CLI?
On a side note #prisma1 might be the go to channel for prisma1 queries. 🙂
d
Sorry will go there next time, yes I installed prisma as dev dependency and prisma1
And thank you, been here before but I forgot how I joined 😅
n
How does your package.json file look like?
d
Copy code
"devDependencies": {
  "prisma": "^3.13.0",
  "prisma1": "^1.34.12"
}
Is there a way to ignore the error? I feel like it should be a warning instead
👀 1
n
Just confirming, Is
@prisma/client
installed as a dependencies as well?
d
Nope, do I need that? I was following the guide
But it didn't mention the need for the prisma client package yet
n
Can you try adding
"@prisma/client": "^3.13.0",
in your dependencies and check?
d
Getting the same error after adding the client package
n
@andrewicarlson should be able to help in fixing this issue, he is helping our prisma1 users migrate to prisma2. What output do you get when you execute
npx prima --version
d
Gives me the same error
Hm after reading again, I think you are supposed to uninstall and reinstall each time you want to use prisma 1 😅
Nvm uninstalling doesn't seem to get rid of the error
😅 1
n
So uninstalling prisma1 CLI didn’t work, right?
d
It worked after renaming the prisma.yml file
Uninstalling the other CLI didn't change anything
n
Thanks for reporting this, we should add this to our docs
I’ll pass this feedback
d
Also faced some issue in #prisma1, the gradual upgrade path isn't so flawless 😕
a
Hey @Daniell, sorry to hear you're having trouble with the upgrade path.
npx prisma init
does 2 things: 1. Create a
prisma
folder in your project 2. Inside that folder create a single file named
schema.prisma
with the following contents
Copy code
// This is your Prisma schema file,
// learn more about it in the docs: <https://pris.ly/d/prisma-schema>

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

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}
Hopefully that helps you get started!
m
Hey I’m bumping this thread as I ran into the same issue just now. Thanks to Daniell’s comment I tried renaming/deleting my prisma.yml file and that did the trick here as well. Might want to mention in the dock as it seems there’s still some slowpokes like us 😅 (I just decided to resurrect an old project that was on hold)