I use nextjs fresh project with Prisma and supabase database. I’m using ubuntu.
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04 LTS
Release: 22.04
Codename: jammy
when I run Prisma push and generate command in my project. I face the same error with npm and yarn.
I run all Prisma command. I start with a fresh supabase database.
prisma migrate dev
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: Get config: Unable to establish a connection to query-engine-node-api library
Prisma CLI Version : 3.15.2
npx prisma db push
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Error: Get config: Unable to establish a connection to query-engine-node-api library
Prisma CLI Version : 3.15.2
prisma/schema.prisma
file
// 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")
}
model User {
id Int @id @default(autoincrement())
email String @unique
name String?
}
After I added the environment variable.
DATABASE_URL="postgresql://postgres:[email protected]:5432/postgres"
I do not find why I'm facing errors with Prisma and supabase. I'm deleting the `node_modules` folder and creating one more project. but the problem is not solved.
2
Answers
I had the same issue. Check if you’re in a sandbox terminal. In my case, my anaconda environment was on and so, I couldn’t initiate the migration. Open a fresh terminal without any environments or sandboxes. Also, Looking into other solutions, I found out that if your nodejs installation is done using
snap
, then also this error occurs. Try reinstalling nodejs usingapt
.I have faced the same error.
Downgrading
node
from 18 to 16 solves this problem for me. I did’t find better solution for this problem. Reference: prisma github comment. I don’t recommend to downgrade though.But prisma works normally on
node 16 lts
.