Title
p

Paulo Spiguel

10/18/2021, 12:24 PM
Hi, I'm having difficulty in a project setup with Prisma, Docker, Postgres and nestjs. Can anyone help me with this error?
node:29) UnhandledPromiseRejectionWarning: Error: Query engine library for current platform "linux-musl" could not be found.
app-api     | You incorrectly pinned it to linux-musl
app-api     | 
app-api     | This probably happens, because you built Prisma Client on a different platform.
app-api     | (Prisma Client looked in "/usr/app/node_modules/@prisma/client/runtime/libquery_engine-linux-musl.so.node")
app-api     | 
app-api     | Searched Locations:
app-api     | 
app-api     |   /usr/app/node_modules/.prisma/client
app-api     |   /home/paulospiguel/www/dkpa/doggie/api/node_modules/@prisma/client
app-api     |   /usr/app/node_modules/@prisma/client
app-api     |   /usr/app/node_modules/.prisma/client
app-api     |   /usr/app/prisma
app-api     |   /tmp/prisma-engines
app-api     |   /usr/app/node_modules/.prisma/client
app-api     | 
app-api     | 
app-api     | To solve this problem, add the platform "linux-musl" to the "binaryTargets" attribute in the "generator" block in the "schema.prisma" file:
app-api     | generator client {
app-api     |   provider      = "prisma-client-js"
app-api     |   binaryTargets = ["native"]
app-api     | }
app-api     | 
app-api     | Then run "prisma generate" for your changes to take effect
``````
j

Jared Fraser

10/19/2021, 4:18 AM
You should just need to include the
binaryTargets
configuration in the client generator part of your schema definition example:
generator client {
  provider        = "prisma-client-js"
  binaryTargets   = ["native", "debian-openssl-1.1.x", "linux-musl"]
  previewFeatures = ["selectRelationCount"]
}