Prisma Client could not locate the Query Engine for runtime: how to fix it
Prisma Client could not locate the Query Engine for runtime debian-openssl-3.0.x, or the older Query engine library for current platform could not be found, means the client was generated for another platform, usually your laptop, or its engine file was not copied. Run prisma generate where the app is built, add the runtime to binaryTargets, and do not ship node_modules. Prisma 7 has no Rust engine, so the error ends there.
By Livops team, the people who build and run LivopsUpdated
What Prisma Client prints when it cannot find its engine, here for an app generated on an Apple Silicon Mac and started on Debian or Ubuntu with OpenSSL 3[1][3][4]:
PrismaClientInitializationError: Prisma Client could not locate the Query Engine for runtime "debian-openssl-3.0.x".
This happened because Prisma Client was generated for "darwin-arm64", but the actual deployment required "debian-openssl-3.0.x".
Add "debian-openssl-3.0.x" to `binaryTargets` in the "schema.prisma" file and run `prisma generate` after saving it:
...
The following locations have been searched:
...
Older releases, such as Prisma 4.7, said the same thing in other words[10]:
Query engine library for current platform "debian-openssl-3.0.x" could not be found.
This probably happens, because you built Prisma Client on a different platform.
This page explains what the query engine is and why it goes missing, gives the fix for each cause the message names, covers the OpenSSL variant, and says which of it still applies on Prisma 6.16 and later and on Prisma 7.
What does the error mean?
Up to Prisma 6, Prisma Client talks to the database through a query engine written in Rust[13]. By default the client loads it as a Node-API library[13]: one native file per platform, named after the platform, such as libquery_engine-debian-openssl-3.0.x.so.node on Linux or libquery_engine-darwin-arm64.dylib.node on an Apple Silicon Mac[8]. prisma generate downloads that file into the generated client[13].
Which files it downloads is set by binaryTargets in the generator block, and the default is native[11]: the platform of the machine that runs prisma generate, as the error’s own wording shows (Prisma Client was generated for "darwin-arm64")[3]. At startup the client works out the platform it is running on, looks for that platform’s file in the generated client folder and a few other places, and throws PrismaClientInitializationError if none has it[2].
The text after the first line tells you which case you are in[2]:
| The message continues with | What happened |
|---|---|
Prisma Client was generated for "…", but the actual deployment required "…" |
The client was generated on another platform, with native only[3] |
`binaryTargets` have been pinned, but the actual deployment also required "…" |
binaryTargets lists platforms, but not this one[5] |
tooling that has not copied "…" to the deployment folder |
The right file was generated, then lost on the way[6] |
a bundler that has not copied "…" next to the resulting bundle |
The client was bundled without its engine file[7] |
The platform names you will meet most[11]:
| Where the app runs | binaryTargets value |
|---|---|
| Debian or Ubuntu, x86_64 | debian-openssl-3.0.x (or -1.1.x, -1.0.x for older OpenSSL) |
| Alpine 3.17 and newer, x86_64 | linux-musl-openssl-3.0.x |
| Alpine 3.16 and older, x86_64 | linux-musl |
| Linux on ARM64, except Alpine | linux-arm64-openssl-3.0.x (or -1.1.x, -1.0.x) |
| macOS | darwin, darwin-arm64 |
| Windows | windows |
Causes, most common first
1. The client was generated on your laptop
You ran prisma generate on macOS or Windows and the result travelled to the server: node_modules in the upload or the image, the generated client committed to Git, or a COPY . . in a Dockerfile that brought your local node_modules along. With native only, that client holds the engine for your laptop and nothing else[3].
Fix: generate where the app is built, and ship no generated code. Keep node_modules and the generated client out of Git, the upload and the Docker build context, and run prisma generate after the dependencies are installed on the build machine. Prisma’s reference recommends adding the client’s output path to .gitignore and running prisma generate from a build script or a postinstall hook[11]:
{
"scripts": {
"postinstall": "prisma generate"
}
}
In a Dockerfile, a .dockerignore keeps the local folder out of the image; Prisma’s current Docker guide lists node_modules, .env and .env.prod in it[19]:
node_modules
.env
.env.prod
2. binaryTargets does not include the platform you deploy to
Generating on one machine and running on another is fine if the client carries both engines. Add the value the error names, next to native so your laptop keeps working, and generate again; it is the fix the message itself suggests[4]:
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "debian-openssl-3.0.x"]
}
If you already list targets and the message says they have been pinned, the list just lacks this platform[5]: add it the same way. Copy the string from the error rather than guessing it: the client prints exactly the platform it was looking for[1].
3. prisma generate never ran, or its output was lost
This is likely caused by tooling that has not copied "libquery_engine-debian-openssl-3.0.x.so.node" to the deployment folder.
Ensure that you ran `prisma generate` and that "libquery_engine-debian-openssl-3.0.x.so.node" has been copied to "…".
The client found the right platform in binaryTargets but not the file[6]. Either prisma generate did not run in the build, so an old or foreign client is in use, or a step after it, such as a multi-stage Dockerfile that copies only some folders, left the engine behind. Run prisma generate in the same stage that installs dependencies, and copy the generated client folder, the default one being node_modules/.prisma/client[11], into the final stage whole.
If the message says a bundler has not copied the file next to the bundle, the client was bundled (by webpack or another bundler) and the .node file stayed behind[7]. Copy it next to the bundle, or into the folder the message names[7].
4. OpenSSL: the library the engine needs is missing
When the file is found but cannot be loaded, the message is different[9]:
Unable to require(`/app/node_modules/.prisma/client/libquery_engine-debian-openssl-1.1.x.so.node`).
Prisma cannot find the required `libssl` system library in your system. Please install openssl-1.1.x and try again.
Details: libssl.so.1.1: cannot open shared object file: No such file or directory
The engine links to the system’s OpenSSL, and Prisma needs OpenSSL 1.0.x, 1.1.x or 3.x on Linux[14]. When it cannot tell which version is installed, for example because none is, it assumes 1.1.x[14], so a slim image without OpenSSL gets the 1.1.x engine and then fails to load it. Prisma’s Docker guide notes that some older node:slim images come without libssl, and installs it[18]:
FROM node:slim
RUN apt-get update -y && apt-get install -y openssl
Then generate again, so the engine matches the OpenSSL that is now there. On Alpine, do not add libc6-compat or another glibc: Prisma’s guide says that would prevent Prisma from running[18]. A message that mentions GLIBC instead means the system’s C library is too old for the engine[9].
Prisma 6.16 and Prisma 7: the engine is gone
The fixes above are for the Rust engine. Prisma has been removing it:
- Prisma 6.16 and later can run without it. Using Prisma without Rust became generally available in 6.16.0 for PostgreSQL, CockroachDB, MySQL, SQLite, SQL Server and others[15]. You set
engineType = "client"in the generator and pass a driver adapter toPrismaClient; no engine is downloaded into the generated client and there is nobinaryTargetsfield[15]. Prisma says it was tested with theprisma-clientgenerator rather thanprisma-client-js[15]. - Prisma 7 makes that the default[13]: the library engine (
engineType = "library") and the binary engine (engineType = "binary") were removed[17], andPRISMA_QUERY_ENGINE_LIBRARYandPRISMA_QUERY_ENGINE_BINARYno longer exist[17]. With no engine file there is nothing for this error to miss.
Upgrading is the most lasting fix, but it changes more than the engine[16]:
generator client {
provider = "prisma-client"
output = "./generated/prisma"
}
- Every database needs a driver adapter, such as
@prisma/adapter-pgfor PostgreSQL[16]. outputis required, and the client is no longer generated intonode_modules[16].prisma-client-jsis deprecated as of Prisma 7[12].migrate devanddb pushno longer runprisma generate; you run it yourself[16]. Keep it in the build or inpostinstall.- Node.js 20.19.0 is the minimum[16].
Prisma’s docs now also cover Prisma ORM 8, still a release candidate, which ships no native query engine and has no prisma generate step at all[19]. What is above applies to Prisma 4 to 7.
How to confirm the fix locally
Generate, then look at which engines the client carries. On Prisma 5 or 6 with the default output:
npx prisma generate
ls node_modules/.prisma/client | grep query_engine
You should see one libquery_engine-… file for every value in binaryTargets, native included[8][13], for example libquery_engine-darwin-arm64.dylib.node and libquery_engine-debian-openssl-3.0.x.so.node. If the platform from the error is not in the list, the deploy cannot find it either. Then check that what you ship does not bring its own copy: git ls-files node_modules | head should print nothing.
On Livops
prisma generateruns before the build. When the project hasprismaandprisma/schema.prisma, Livops runsprisma generatebefore the build itself, so the client is generated during the deploy, not on your laptop. If your schema lives elsewhere, add"postinstall": "prisma generate"topackage.json; see The Prisma client was not generated.node_modulesnever arrives from your machine in an upload. An uploaded folder hasnode_modules,.git,.nextand similar folders dropped, and Livops installs the dependencies itself. From GitHub, keepnode_modulesand the generated client in.gitignore.- Node 22 or 24. Those are the versions Livops has, both above Prisma 7’s minimum. If
devEnginesinpackage.jsonasks for another, set it to 22 or 24. - Your own Dockerfile. A Dockerfile in the repository is used when no framework is recognised; for a recognised project,
"builder": "dockerfile"inlivops.jsonbefore the project is created. The image is then yours, OpenSSL andbinaryTargetsincluded. - A failed start keeps the old version. If the client throws at start-up, the deploy fails as
start_failed, the message is on the Logs page, and a web app’s previous version keeps serving.
A web app costs 39 credits a month. Once the client starts, the next error on the way is usually the connection: Prisma P1001: Can’t reach database server.
Questions
Why does Prisma work on my Mac and fail on the server?
Because the client was generated on the Mac. With the default binaryTargets, native, prisma generate downloads only the engine for the machine it runs on, a darwin or darwin-arm64 file. The Linux server needs another file, such as the one for debian-openssl-3.0.x, and it is not there.
Which binaryTargets value do I need?
The one the error names after for runtime. Prisma prints the platform it was looking for, so add exactly that string next to native, for example debian-openssl-3.0.x on Debian or Ubuntu with OpenSSL 3, or linux-musl-openssl-3.0.x on Alpine 3.17 and newer, and run prisma generate again.
Should I add prisma generate to postinstall?
It is the simplest way to make sure the client is generated wherever dependencies are installed, and Prisma's own reference recommends a build script or a postinstall hook. Prisma 7 no longer generates the client for you after migrate dev or db push, so the explicit step matters more there.
Is it safe to commit node_modules or the generated client?
Not across platforms. Whatever you commit carries the engine for the machine that generated it. Keep both out of the repository and the upload, and let the build install dependencies and run prisma generate on the platform the app runs on.
What does libssl.so cannot open shared object file mean with Prisma?
The engine file was found but needs an OpenSSL library the system does not have. Prisma says it cannot find the required libssl system library and names the OpenSSL version to install. Install openssl in the image, or make the engine match the OpenSSL that is there.
Does Prisma 7 still have this error?
Not from Prisma Client. Prisma 7 removed the library and binary query engines, so there is no engine file to look for. It needs a driver adapter for every database and an output path for the generated client, and you still run prisma generate yourself.
Sources
- Prisma source — queryEngineCannotBeFound.ts (6.19.3) (raw.githubusercontent.com). Checked .
- Prisma source — resolveEnginePath.ts (6.19.3) (raw.githubusercontent.com). Checked .
- Prisma source — nativeGeneratedOnDifferentPlatform.ts (6.19.3) (raw.githubusercontent.com). Checked .
- Prisma source — addRuntimeToYourBinaryTargets.ts (6.19.3) (raw.githubusercontent.com). Checked .
- Prisma source — binaryTargetsWasIncorrectlyPinned.ts (6.19.3) (raw.githubusercontent.com). Checked .
- Prisma source — toolingHasTamperedWithEngineCopy.ts (6.19.3) (raw.githubusercontent.com). Checked .
- Prisma source — bundlerHasTamperedWithEngineCopy.ts (6.19.3) (raw.githubusercontent.com). Checked .
- Prisma source — getNodeAPIName.ts (6.19.3) (raw.githubusercontent.com). Checked .
- Prisma source — handleEngineLoadingErrors.ts (6.19.3) (raw.githubusercontent.com). Checked .
- Prisma source — DefaultLibraryLoader.ts (4.7.0) (raw.githubusercontent.com). Checked .
- Prisma ORM v6 — Prisma Schema API (prisma.io). Checked .
- Prisma ORM v6 — Generators (prisma.io). Checked .
- Prisma ORM v6 — Engines (prisma.io). Checked .
- Prisma ORM v6 — System requirements (prisma.io). Checked .
- Prisma ORM v6 — No Rust engine (prisma.io). Checked .
- Prisma — Upgrade to Prisma ORM 7 (prisma.io). Checked .
- Prisma changelog — Prisma ORM v7.0.0 (prisma.io). Checked .
- Prisma ORM v7 — How to use Prisma in Docker (prisma.io). Checked .
- Prisma — How to use Prisma ORM in Docker (Prisma ORM 8) (prisma.io). Checked .
Put your project online today
Connect GitHub or drop a folder. No card is asked for.
Deploy your Node.js appRelated
- Prisma P1001: Can't reach database server at … — how to fix itPrisma tried the host and port in your connection URL and nothing answered there. After a deploy that is almost always a URL that says localhost, a database that is not attached to the project, or prisma migrate deploy running in a build that has no database. Read the host in the message first: it tells you which.
- Error: Cannot find module (MODULE_NOT_FOUND) in Node.js: how to fix itError: Cannot find module 'x' with code MODULE_NOT_FOUND, or ERR_MODULE_NOT_FOUND with import, means Node.js looked for a package or file and it was not there. On a server the usual causes are a package missing from package.json, a devDependency the install skipped, a path whose case differs from the file, a start command pointing at a file that was never built, or an ES module import without its .js extension.
- Node.js hosting in 2026: how to deploy an Express appA Node.js server in production needs one long-running process that listens on the port it is given, restarts when it crashes and exits cleanly on SIGTERM. On Livops you push a repository with package.json and it runs as a web app for 39 credits a month (39,000 so'm). Here is what Node needs, and how a VPS, Render, Railway, Fly.io, DigitalOcean and Heroku compare.
- Managed PostgreSQL hosting in 2026: the options comparedA production PostgreSQL needs backups you can restore, a connection limit your app stays under, the app in the same region, and a supported version. On Livops a PostgreSQL 15, 16 or 17 database runs inside your project, its DATABASE_URL is written into your services, and it is backed up every night; 500 MB is free, one per team, and 1 GB is 9 credits a month. Here is how the paid plans of Neon, Supabase, Render, Railway and a VPS compare; free tiers have their own page.
- exec format error in Docker: the image was built for another CPUThe kernel refused to run the container's program because it is not an executable for this machine: almost always a binary or image built for arm64 (an Apple Silicon Mac) running on an amd64 server, or the reverse. Build for the server's platform with --platform linux/amd64, or as a multi-platform image; if the file is a script, give it a #! line.
- Next.js hosting without Vercel: the options comparedNext.js runs on any host that runs Node: next build, then next start, and every feature works, Server Actions and image optimization included. On Livops a repository with next in package.json runs as a server from a push for 39 credits a month (39,000 so'm), and a static export is free. Here is how Vercel, Render, Railway, Fly.io and a VPS compare.