What we want to achieve is to build linux and windows installers for our Electron app on our (Linux) build server.
After installing Wine, this basically works, except for Prisma:
i.e. Prisma relies on OS-specific binaries - thus, we must have the correct binaries available for each platform.
This part works: we set the binaryTarget to our target platforms: binaryTargets = ["windows", "debian-openssl-1.1.x"]
.
When we now generate the client (prisma generate
), the target dir (node_modules/.prisma/client/
) contains the query-engines for linux and windows: libquery_engine-debian-openssl-1.1.x.so.node
, query_engine-windows.dll.node
i.e. in package.json
we only specify the prisma
dependency and npm will only install the binaries for the current OS in node_modules/@prisma/engines/
, i.e.: libquery_engine-debian-openssl-1.1.x.so.node
, migration-engine-debian-openssl-1.1.x
How can we get npm to install both migration Engines (i.e. for Windows and Linux)?
PRISMA_CLI_BINARY_TARGETS=darwin,rhel-openssl-1.0.x npm install
npm install
node_modules/@prisma/engines
node_modules/@prisma/engines
and starting npm install
again, it worked