error states Unable to require(node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node) while npx performing prisma generate

Viewed 1452

I have a node.js project with prisma as ORM that connects to postgresdb. After I installed dependencies with yarn install I tried to run command npx prisma generate then I got error stating Unable to require(/node_modules/prisma/libquery_engine-debian-openssl-1.1.x.so.node) libssl.so.1.1: cannot open shared object file: No such file or directory.

local setup

I have ubuntu 22.04 with node version of v16.14.2.

1 Answers

You would need to add an option of binaryTargets in generator block in your schema.prisma file as mentioned in docs.

Adding debian-openssl-1.1.x to your generator should solve your issue.

generator client {
  provider      = "prisma-client-js"
  binaryTargets = ["debian-openssl-1.1.x"]
}
Related