Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide precompiled binaries for Windows on ARM #15306

Open
brennomeneses opened this issue Sep 14, 2022 · 17 comments
Open

Provide precompiled binaries for Windows on ARM #15306

brennomeneses opened this issue Sep 14, 2022 · 17 comments
Labels
domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/feature A request for a new feature. topic: arm topic: cli topic: prisma generate CLI: prisma generate topic: windows

Comments

@brennomeneses
Copy link

Bug description

I just cannot pull my prisma schema to my database

PS C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge> yarn prisma generate
yarn run v1.22.19
$ C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge\node_modules\.bin\prisma generate
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Error: Unable to establish a connection to query-engine-node-api library. It seems that the current architecture arm64 is not supported, or that libc is missing from the system.
Details: Unable to require(`C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge\node_modules\prisma\query_engine-windows.dll.node`)
 \\?\C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge\node_modules\prisma\query_engine-windows.dll.node is not a valid Win32 application.
\\?\C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge\node_modules\prisma\query_engine-windows.dll.node
[Context: getConfig]

How to reproduce

Expected behavior

Generate the prisma client

Prisma information

generator client {
  provider = "prisma-client-js"
}

datasource db {
  provider = "postgresql"
  url      = env("DATABASE_URL")
}

model Functionary {
  id   Int    @id @default(autoincrement())
  name String
  pis  String
}
// Add your code using Prisma Client

Environment & setup

  • OS: Windows 10 on ARM
  • Database: PostgreSQL
  • Node.js version: v16.13.0

Prisma Version

prisma                  : 4.3.1
@prisma/client          : Not found
Current platform        : windows
Query Engine (Node-API) : E_CANNOT_RESOLVE_VERSION (at node_modules\@prisma\engines\query_engine-windows.dll.node)
Migration Engine        : E_CANNOT_RESOLVE_VERSION (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine    : E_CANNOT_RESOLVE_VERSION (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary           : E_CANNOT_RESOLVE_VERSION (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Format Wasm             : @prisma/prisma-fmt-wasm 4.3.0-32.c875e43600dfe042452e0b868f7a48b817b9640b
Default Engines Hash    : c875e43600dfe042452e0b868f7a48b817b9640b
Studio                  : 0.473.0
@brennomeneses brennomeneses added the kind/bug A reported bug. label Sep 14, 2022
@janpio janpio added topic: exit code 3221225781 domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Sep 14, 2022
@janpio
Copy link
Member

janpio commented Sep 14, 2022

Can you try with prisma@4.2.0? It might be as simple as us not building any engines for Windows ARM, but we also recently changed the error output handling of prisma -v - so I would be interesting in both the output of prisma generate and prisma -v with that version. Thanks!

@brennomeneses
Copy link
Author

brennomeneses commented Sep 14, 2022

Of course!
Here is the: prisma -v

prisma                  : 4.2.0
@prisma/client          : Not found
Current platform        : windows
Query Engine (Node-API) : E_CANNOT_RESOLVE_VERSION (at node_modules\@prisma\engines\query_engine-windows.dll.node)
Migration Engine        : E_CANNOT_RESOLVE_VERSION (at node_modules\@prisma\engines\migration-engine-windows.exe)
Introspection Engine    : E_CANNOT_RESOLVE_VERSION (at node_modules\@prisma\engines\introspection-engine-windows.exe)
Format Binary           : E_CANNOT_RESOLVE_VERSION (at node_modules\@prisma\engines\prisma-fmt-windows.exe)
Default Engines Hash    : 2920a97877e12e055c1333079b8d19cee7f33826
Studio                  : 0.469.0

But he handle a lot of error (with is too big), I pasted in pastebin: https://pastebin.com/gmrqUZFL

and here is the prisma generate

PS C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge> yarn prisma generate
yarn run v1.22.19
$ C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge\node_modules\.bin\prisma generate
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.
Details: Unable to require(`C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge\node_modules\prisma\query_engine-windows.dll.node`)
 \\?\C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge\node_modules\prisma\query_engine-windows.dll.node is not a valid Win32 application.
\\?\C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge\node_modules\prisma\query_engine-windows.dll.node

Prisma CLI Version : 4.2.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

@janpio
Copy link
Member

janpio commented Sep 14, 2022

Thank you for the pastebin! Just to confirm, was something similar also available for 4.3.1?

This is the additional relevat information from the pastebin (one example):

Error: Command failed with UNKNOWN: C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge\node_modules\@prisma\engines\migration-engine-windows.exe --version    
spawn UNKNOWN
    at ChildProcess.spawn (node:internal/child_process:412:11)
    at Object.spawn (node:child_process:698:9)
    at execa (C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge\node_modules\prisma\build\index.js:4352:32)
    at getEngineVersion (C:\Users\brenn\OneDrive\Documentos\Faculdade\DOR\cocierge\node_modules\prisma\build\index.js:88832:52)
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  errno: -4094,
  code: 'UNKNOWN',
  syscall: 'spawn',
  originalMessage: 'spawn UNKNOWN',
  shortMessage: 'Command failed with UNKNOWN: C:\\Users\\brenn\\OneDrive\\Documentos\\Faculdade\\DOR\\cocierge\\node_modules\\@prisma\\engines\\migration-engine-windows.exe --version\n' +
    'spawn UNKNOWN',
  command: 'C:\\Users\\brenn\\OneDrive\\Documentos\\Faculdade\\DOR\\cocierge\\node_modules\\@prisma\\engines\\migration-engine-windows.exe --version',
  escapedCommand: '"C:\\Users\\brenn\\OneDrive\\Documentos\\Faculdade\\DOR\\cocierge\\node_modules\\@prisma\\engines\\migration-engine-windows.exe" --version',      
  exitCode: undefined,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: '',
  all: '',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

So the binaries are failing with errno: -4094 - whatever that means.

@janpio
Copy link
Member

janpio commented Sep 14, 2022

Some interesting context, so probably Windows ARM related indeed: vercel/pkg#1482 vercel/pkg#1663

@brennomeneses
Copy link
Author

brennomeneses commented Sep 15, 2022

Thank you for the pastebin! Just to confirm, was something similar also available for 4.3.1?

The error returned from the prisma generate was excatly the same (Except for the version of prisma of course). I think thouse binaries in @prisma/engine are not builded for ARM64 (being that I have Visual C++ Redistributable for ARM64)

@brennomeneses
Copy link
Author

Good news!
I upgraded to Windows 11, and with then it game Arm64EC, with is very similar to Rosetta (for MacOS) or WineHQ (for Linux), with make the possibility to run 64bits apps in my machine.

So I just installed the NodeJS (x64) LTS from the NodeJS repository and I can switch between then using nvm

nvm use 17.4.0 # Version with Windows ARM binaries

and

nvm use 16.17.1 # Version for Windows 64 bits

So then I just:

yarn prisma db push
yarn run v1.22.19
$ C:\Users\Samsung\Documents\faculdade\cocierge\node_modules\.bin\prisma db push
Environment variables loaded from .env
Prisma schema loaded from prisma\schema.prisma
Datasource "db": PostgreSQL database "pg_cocierge", schema "public" at "localhost:5432"

The database is already in sync with the Prisma schema.

✔ Generated Prisma Client (4.3.1 | library) to .\node_modules\@prisma\client in 461ms

Done in 7.71s.

Working as normal

@dxgi
Copy link

dxgi commented Oct 17, 2022

I had the same issue on fresh install of Windows 11 64x on NodeJS (v16.18.0 LTS)

All I had to do is install the necessary Visual Studio C++ Redistributable

@arily
Copy link

arily commented Oct 20, 2022

I got same error in alpine-arm64 in docker.

here's what I got:

077032e17b60:/osu-server/guweb-next# yarn prisma generate
yarn run v1.22.19
$ /osu-server/guweb-next/node_modules/.bin/prisma generate
Prisma schema loaded from src/prisma/schema.prisma
Error: Unable to establish a connection to query-engine-node-api library. It seems that the current architecture arm64 is not supported, or that libc is missing from the system.
Details: Unable to require(`/osu-server/guweb-next/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node`)
 Error relocating /osu-server/guweb-next/node_modules/prisma/libquery_engine-linux-arm64-openssl-1.1.x.so.node: __res_init: symbol not found
[Context: getConfig]

Prisma CLI Version : 4.5.0
error Command failed with exit code 1.
077032e17b60:/osu-server/guweb-next# yarn prisma -v
yarn run v1.22.19
$ /osu-server/guweb-next/node_modules/.bin/prisma -v
Error: Unable to require(`/osu-server/guweb-next/node_modules/@prisma/engines/libquery_engine-linux-arm64-openssl-1.1.x.so.node`)
 Error relocating /osu-server/guweb-next/node_modules/@prisma/engines/libquery_engine-linux-arm64-openssl-1.1.x.so.node: __res_init: symbol not found
    at load (/osu-server/guweb-next/node_modules/prisma/build/index.js:89179:11)
    at getEngineVersion (/osu-server/guweb-next/node_modules/prisma/build/index.js:89902:16)
Error: Command failed with exit code 127: /osu-server/guweb-next/node_modules/@prisma/engines/migration-engine-linux-arm64-openssl-1.1.x --version
Error relocating /osu-server/guweb-next/node_modules/@prisma/engines/migration-engine-linux-arm64-openssl-1.1.x: __res_init: symbol not found
    at makeError (/osu-server/guweb-next/node_modules/prisma/build/index.js:3641:18)
    at handlePromise (/osu-server/guweb-next/node_modules/prisma/build/index.js:4409:33)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async getEngineVersion (/osu-server/guweb-next/node_modules/prisma/build/index.js:89905:20) {
  shortMessage: 'Command failed with exit code 127: /osu-server/guweb-next/node_modules/@prisma/engines/migration-engine-linux-arm64-openssl-1.1.x --version',
  command: '/osu-server/guweb-next/node_modules/@prisma/engines/migration-engine-linux-arm64-openssl-1.1.x --version',
  escapedCommand: '"/osu-server/guweb-next/node_modules/@prisma/engines/migration-engine-linux-arm64-openssl-1.1.x" --version',
  exitCode: 127,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'Error relocating /osu-server/guweb-next/node_modules/@prisma/engines/migration-engine-linux-arm64-openssl-1.1.x: __res_init: symbol not found',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
Error: Command failed with exit code 127: /osu-server/guweb-next/node_modules/@prisma/engines/introspection-engine-linux-arm64-openssl-1.1.x --version
Error relocating /osu-server/guweb-next/node_modules/@prisma/engines/introspection-engine-linux-arm64-openssl-1.1.x: __res_init: symbol not found
    at makeError (/osu-server/guweb-next/node_modules/prisma/build/index.js:3641:18)
    at handlePromise (/osu-server/guweb-next/node_modules/prisma/build/index.js:4409:33)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async getEngineVersion (/osu-server/guweb-next/node_modules/prisma/build/index.js:89905:20) {
  shortMessage: 'Command failed with exit code 127: /osu-server/guweb-next/node_modules/@prisma/engines/introspection-engine-linux-arm64-openssl-1.1.x --version',
  command: '/osu-server/guweb-next/node_modules/@prisma/engines/introspection-engine-linux-arm64-openssl-1.1.x --version',
  escapedCommand: '"/osu-server/guweb-next/node_modules/@prisma/engines/introspection-engine-linux-arm64-openssl-1.1.x" --version',
  exitCode: 127,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'Error relocating /osu-server/guweb-next/node_modules/@prisma/engines/introspection-engine-linux-arm64-openssl-1.1.x: __res_init: symbol not found',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
Error: Command failed with exit code 1: /osu-server/guweb-next/node_modules/@prisma/engines/prisma-fmt-linux-arm64-openssl-1.1.x --version
prisma-fmt 0362da9eebca54d94c8ef5edd3b2e90af99ba452
Prisma Datamodel v2 formatter

USAGE:
    prisma-fmt <SUBCOMMAND>

FLAGS:
    -h, --help       Prints help information
    -V, --version    Prints version information

SUBCOMMANDS:
    debug-panic            Artificially panic (for testing the CLI)
    format                 Specifies format mode
    help                   Prints this message or the help of the given subcommand(s)
    lint                   Specifies linter mode
    native-types           Specifies Native Types mode
    preview-features       Specifies preview features mode
    referential-actions    List of available referential actions
    at makeError (/osu-server/guweb-next/node_modules/prisma/build/index.js:3641:18)
    at handlePromise (/osu-server/guweb-next/node_modules/prisma/build/index.js:4409:33)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async getEngineVersion (/osu-server/guweb-next/node_modules/prisma/build/index.js:89905:20) {
  shortMessage: 'Command failed with exit code 1: /osu-server/guweb-next/node_modules/@prisma/engines/prisma-fmt-linux-arm64-openssl-1.1.x --version',
  command: '/osu-server/guweb-next/node_modules/@prisma/engines/prisma-fmt-linux-arm64-openssl-1.1.x --version',
  escapedCommand: '"/osu-server/guweb-next/node_modules/@prisma/engines/prisma-fmt-linux-arm64-openssl-1.1.x" --version',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: 'prisma-fmt 0362da9eebca54d94c8ef5edd3b2e90af99ba452\n' +
    'Prisma Datamodel v2 formatter\n' +
    '\n' +
    'USAGE:\n' +
    '    prisma-fmt <SUBCOMMAND>\n' +
    '\n' +
    'FLAGS:\n' +
    '    -h, --help       Prints help information\n' +
    '    -V, --version    Prints version information\n' +
    '\n' +
    'SUBCOMMANDS:\n' +
    '    debug-panic            Artificially panic (for testing the CLI)\n' +
    '    format                 Specifies format mode\n' +
    '    help                   Prints this message or the help of the given subcommand(s)\n' +
    '    lint                   Specifies linter mode\n' +
    '    native-types           Specifies Native Types mode\n' +
    '    preview-features       Specifies preview features mode\n' +
    '    referential-actions    List of available referential actions',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}
prisma                  : 4.5.0
@prisma/client          : 4.5.0
Current platform        : linux-arm64-openssl-1.1.x
Query Engine (Node-API) : E_CANNOT_RESOLVE_VERSION (at node_modules/@prisma/engines/libquery_engine-linux-arm64-openssl-1.1.x.so.node)
Migration Engine        : E_CANNOT_RESOLVE_VERSION (at node_modules/@prisma/engines/migration-engine-linux-arm64-openssl-1.1.x)
Introspection Engine    : E_CANNOT_RESOLVE_VERSION (at node_modules/@prisma/engines/introspection-engine-linux-arm64-openssl-1.1.x)
Format Binary           : E_CANNOT_RESOLVE_VERSION (at node_modules/@prisma/engines/prisma-fmt-linux-arm64-openssl-1.1.x)
Format Wasm             : @prisma/prisma-fmt-wasm 4.5.0-43.0362da9eebca54d94c8ef5edd3b2e90af99ba452
Default Engines Hash    : 0362da9eebca54d94c8ef5edd3b2e90af99ba452
Studio                  : 0.476.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
077032e17b60:/osu-server/guweb-next# 

@hkbertoson
Copy link

I get this error when trying to build a Dockerfile. I am on a Macbook M1

Docker build error

 docker build --no-cache -t nextjs-prisma .
[+] Building 13.6s (12/18)                                                                                                                                                                                      
 => [internal] load build definition from Dockerfile                                                                                                                                                       0.0s
[+] Building 13.7s (12/18)                                                                                                                                                                                      
 => [internal] load .dockerignore                                                                                                                                                                          0.0s
[+] Building 31.1s (14/18)                                                                                                                                                                                      
 => [internal] load build definition from Dockerfile                                                                                                                                                       0.0s
 => => transferring dockerfile: 841B                                                                                                                                                                       0.0s
 => [internal] load .dockerignore                                                                                                                                                                          0.0s
 => => transferring context: 34B                                                                                                                                                                           0.0s
 => [internal] load metadata for docker.io/library/node:16-alpine                                                                                                                                          0.9s
 => CACHED [builder  1/10] FROM docker.io/library/node:16-alpine@sha256:2175727cef5cad4020cb77c8c101d56ed41d44fbe9b1157c54f820e3d345eab1                                                                   0.0s
 => [internal] load build context                                                                                                                                                                          0.1s
 => => transferring context: 41.05kB                                                                                                                                                                       0.1s
 => CACHED [runner 2/5] WORKDIR /app                                                                                                                                                                       0.0s 
 => [runner 3/5] RUN addgroup --system --gid 1001 nodejs                                                                                                                                                   1.1s 
 => [builder  2/10] RUN apk add --no-cache libc6-compat                                                                                                                                                    1.7s
 => [runner 4/5] RUN adduser --system --uid 1001 nextjs                                                                                                                                                    0.2s 
 => [builder  3/10] RUN apk add openssl                                                                                                                                                                    0.9s 
 => [builder  4/10] WORKDIR /app                                                                                                                                                                           0.0s 
 => [builder  5/10] COPY . .                                                                                                                                                                               2.6s
 => [builder  6/10] RUN npm ci                                                                                                                                                                            21.8s
 => ERROR [builder  7/10] RUN npx prisma migrate deploy                                                                                                                                                    3.0s 
------                                                                                                                                                                                                          
 > [builder  7/10] RUN npx prisma migrate deploy:
#14 2.799 Environment variables loaded from .env
#14 2.799 Prisma schema loaded from prisma/schema.prisma
#14 2.817 Error: Unable to establish a connection to query-engine-node-api library. It seems that the current architecture arm64 is not supported, or that libc is missing from the system.
#14 2.817 Details: Unable to require(`/app/node_modules/@prisma/engines/libquery_engine-linux-arm64-openssl-1.1.x.so.node`)
#14 2.817  Error relocating /app/node_modules/@prisma/engines/libquery_engine-linux-arm64-openssl-1.1.x.so.node: __res_init: symbol not found
#14 2.817 [Context: getConfig]
#14 2.817 
#14 2.817 Prisma CLI Version : 4.3.1
------
executor failed running [/bin/sh -c npx prisma migrate deploy]: exit code: 1

DockerFile

FROM node:16-alpine AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk add openssl
WORKDIR /app
COPY . .
RUN npm ci
ENV NEXT_TELEMETRY_DISABLED 1
RUN npx prisma migrate deploy
RUN npx prisma generate
RUN npm run build
RUN mkdir -p /app/.next/cache/images
# Production image, copy all the files and run next
FROM node:16-alpine AS runner
WORKDIR /app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --chown=nextjs:nodejs --from=builder /app/ ./
USER nextjs
ENV PORT 3000
CMD ["npm", "run","start"]

Prisma Schema

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["referentialIntegrity"]
  binaryTargets=["native"]
}

datasource db {
  provider             = "mysql"
  url                  = env("DATABASE_URL")
  referentialIntegrity = "prisma"
}

ajitgoel added a commit to ajitgoel/redwood that referenced this issue Nov 13, 2022
Got "Error: Unable to establish a connection to query-engine-node-api library. It seems that the current architecture x64 is not supported, or that libc is missing from the system.
Details: Unable to require(`C:\t\faxtogo2\node_modules\prisma\query_engine-windows.dll.node`)
 The specified module could not be found.
\\?\C:\t\faxtogo2\node_modules\prisma\query_engine-windows.dll.node
[Context: getConfig]

Prisma CLI Version : 4.3.1", was able to fix error by install Microsoft Visual C++ Redistributable based on prisma/prisma#15306
@janpio janpio added the domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. label Dec 5, 2022
@olegKusov
Copy link

olegKusov commented Dec 17, 2022

Same issue with on macbook pro 2017 with Intel cpu. Docker with Node 16 alpine

 => ERROR [5/6] RUN npx prisma generate                                                                                                   3.3s
------                                                                                                                                         
 > [5/6] RUN npx prisma generate:
#0 2.863 Prisma schema loaded from prisma/schema.prisma
#0 3.299 Error: Get config: Unable to establish a connection to query-engine-node-api library
#0 3.299 
#0 3.299 Prisma CLI Version : 3.15.2
------
failed to solve: executor failed running [/bin/sh -c npx prisma generate]: exit code: 1


@olegKusov
Copy link

So, the answer is: in alpine node there is no open ssl package after some update. and need to use this (#16232 (comment))

@jkomyno
Copy link
Contributor

jkomyno commented Dec 19, 2022

Hey @olegKusov, please refer to #16553 (comment) for solving the problem you're facing when using Linux Alpine.

@jkomyno jkomyno changed the title Error: Unable to establish a connection to query-engine-node-api library. It seems that the current architecture arm64 is not supported, or that libc is missing from the system. Provide precompiled binaries for Windows on ARM Dec 21, 2022
@jkomyno jkomyno added kind/feature A request for a new feature. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. labels Dec 21, 2022
jtoar added a commit to redwoodjs/redwood that referenced this issue Jan 21, 2023
* Update windows-development-setup.md

Got "Error: Unable to establish a connection to query-engine-node-api library. It seems that the current architecture x64 is not supported, or that libc is missing from the system.
Details: Unable to require(`C:\t\faxtogo2\node_modules\prisma\query_engine-windows.dll.node`)
 The specified module could not be found.
\\?\C:\t\faxtogo2\node_modules\prisma\query_engine-windows.dll.node
[Context: getConfig]

Prisma CLI Version : 4.3.1", was able to fix error by install Microsoft Visual C++ Redistributable based on prisma/prisma#15306

* move to troubleshooting section

Co-authored-by: Simon Gagnon <git@simoncrypta.dev>
Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>
jtoar added a commit to redwoodjs/redwood that referenced this issue Jan 22, 2023
* Update windows-development-setup.md

Got "Error: Unable to establish a connection to query-engine-node-api library. It seems that the current architecture x64 is not supported, or that libc is missing from the system.
Details: Unable to require(`C:\t\faxtogo2\node_modules\prisma\query_engine-windows.dll.node`)
 The specified module could not be found.
\\?\C:\t\faxtogo2\node_modules\prisma\query_engine-windows.dll.node
[Context: getConfig]

Prisma CLI Version : 4.3.1", was able to fix error by install Microsoft Visual C++ Redistributable based on prisma/prisma#15306

* move to troubleshooting section

Co-authored-by: Simon Gagnon <git@simoncrypta.dev>
Co-authored-by: Dominic Saadi <dominiceliassaadi@gmail.com>
@gholiveira29
Copy link

Could you help me with this error?
npx prisma migrate dev
Error: Unable to establish a connection to query-engine-node-api library. It seems that the current architecture x64 is not supported, or that libc is missing from the system.
Details: Unable to require(C:\projetos\habities\server\node_modules\@prisma\engines\query_engine-windows.dll.node)
Não foi possível encontrar o módulo especificado.
\?\C:\projetos\habities\server\node_modules@prisma\engines\query_engine-windows.dll.node
[Context: getDmmf]

Prisma CLI Version : 4.9.0

@janpio
Copy link
Member

janpio commented Jan 31, 2023

Please open a new issue @gholiveira29 and provide all the information the bug issue template asks for. Thanks.

@jopijuco
Copy link

I get this error when trying to build a Dockerfile. I am on a Macbook M1

Docker build error

 docker build --no-cache -t nextjs-prisma .
[+] Building 13.6s (12/18)                                                                                                                                                                                      
 => [internal] load build definition from Dockerfile                                                                                                                                                       0.0s
[+] Building 13.7s (12/18)                                                                                                                                                                                      
 => [internal] load .dockerignore                                                                                                                                                                          0.0s
[+] Building 31.1s (14/18)                                                                                                                                                                                      
 => [internal] load build definition from Dockerfile                                                                                                                                                       0.0s
 => => transferring dockerfile: 841B                                                                                                                                                                       0.0s
 => [internal] load .dockerignore                                                                                                                                                                          0.0s
 => => transferring context: 34B                                                                                                                                                                           0.0s
 => [internal] load metadata for docker.io/library/node:16-alpine                                                                                                                                          0.9s
 => CACHED [builder  1/10] FROM docker.io/library/node:16-alpine@sha256:2175727cef5cad4020cb77c8c101d56ed41d44fbe9b1157c54f820e3d345eab1                                                                   0.0s
 => [internal] load build context                                                                                                                                                                          0.1s
 => => transferring context: 41.05kB                                                                                                                                                                       0.1s
 => CACHED [runner 2/5] WORKDIR /app                                                                                                                                                                       0.0s 
 => [runner 3/5] RUN addgroup --system --gid 1001 nodejs                                                                                                                                                   1.1s 
 => [builder  2/10] RUN apk add --no-cache libc6-compat                                                                                                                                                    1.7s
 => [runner 4/5] RUN adduser --system --uid 1001 nextjs                                                                                                                                                    0.2s 
 => [builder  3/10] RUN apk add openssl                                                                                                                                                                    0.9s 
 => [builder  4/10] WORKDIR /app                                                                                                                                                                           0.0s 
 => [builder  5/10] COPY . .                                                                                                                                                                               2.6s
 => [builder  6/10] RUN npm ci                                                                                                                                                                            21.8s
 => ERROR [builder  7/10] RUN npx prisma migrate deploy                                                                                                                                                    3.0s 
------                                                                                                                                                                                                          
 > [builder  7/10] RUN npx prisma migrate deploy:
#14 2.799 Environment variables loaded from .env
#14 2.799 Prisma schema loaded from prisma/schema.prisma
#14 2.817 Error: Unable to establish a connection to query-engine-node-api library. It seems that the current architecture arm64 is not supported, or that libc is missing from the system.
#14 2.817 Details: Unable to require(`/app/node_modules/@prisma/engines/libquery_engine-linux-arm64-openssl-1.1.x.so.node`)
#14 2.817  Error relocating /app/node_modules/@prisma/engines/libquery_engine-linux-arm64-openssl-1.1.x.so.node: __res_init: symbol not found
#14 2.817 [Context: getConfig]
#14 2.817 
#14 2.817 Prisma CLI Version : 4.3.1
------
executor failed running [/bin/sh -c npx prisma migrate deploy]: exit code: 1

DockerFile

FROM node:16-alpine AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN apk add openssl
WORKDIR /app
COPY . .
RUN npm ci
ENV NEXT_TELEMETRY_DISABLED 1
RUN npx prisma migrate deploy
RUN npx prisma generate
RUN npm run build
RUN mkdir -p /app/.next/cache/images
# Production image, copy all the files and run next
FROM node:16-alpine AS runner
WORKDIR /app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --chown=nextjs:nodejs --from=builder /app/ ./
USER nextjs
ENV PORT 3000
CMD ["npm", "run","start"]

Prisma Schema

generator client {
  provider        = "prisma-client-js"
  previewFeatures = ["referentialIntegrity"]
  binaryTargets=["native"]
}

datasource db {
  provider             = "mysql"
  url                  = env("DATABASE_URL")
  referentialIntegrity = "prisma"
}

To overcome this on the docker command, I pass the flag --platform linux/amd64 to specify the target architecture and it worked.

@StrawMonkey
Copy link

Please fix this, I cant run Prisma on my new Surface 🥲

@jkomyno
Copy link
Contributor

jkomyno commented Feb 27, 2023

Hey @StrawMonkey, would you consider running Prisma on WSL2 (Microsoft Docs)? We strongly recommend it, as supporting Prisma on Windows ARM isn't something we will probably be able to provide support for soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain/client Issue in the "Client" domain: Prisma Client, Prisma Studio etc. domain/schema Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc. kind/feature A request for a new feature. topic: arm topic: cli topic: prisma generate CLI: prisma generate topic: windows
Projects
None yet
Development

No branches or pull requests