question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Provide precompiled binaries for Windows on ARM

See original GitHub issue

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

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

13reactions
hkbertosoncommented, Oct 21, 2022

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"
}

3reactions
dxgicommented, 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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Building libraries for Windows on Arm
This guide uses Microsoft Visual Studio to compile and build libraries. Visual Studio is only supported on devices using a x86-based or AMD64/ ......
Read more >
CMake release binaries for Windows on ARM (#21902) · Issues
The next step here is to get Windows ARM hardware for CI so we can run the test suite and (future) packaging pipelines....
Read more >
Where can I find the binaries for arm-wince-pe-gcc?
I'm using CEGCC from SourceForce: http://cegcc.sourceforge.net/, and so far it works OK. I've managed to build a Windows API application, ...
Read more >
Downloads Page - System.Data.SQLite.org.
This project makes use of Eagle, provided by Mistachkin Systems. Eagle: Secure Software Automation ... The Precompiled Binaries for Windows CE (.
Read more >
Building native software - Gradle User Manual
These binaries may vary based on the tool chain used to build, the compiler/linker flags supplied, the dependencies provided, or additional source files ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found