prisma: Installation error using Node 32-bit

Bug description

I’m using Node 32-bit on Windows 11 Pro x64. I’m following the “Start from scratch” guide on your website. When I type npx prisma init I get the follow error:

Error: The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set engineType = "binary" in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)

I am unable to add engineType="binary" to my “schema.prisma” file because it doesn’t get generated. Even if I create the “schema.prisma” file and the “.env” file and add engineType="binary" to it, I still get the same error when running npx prisma generate

How to reproduce

Follow guide at : https://www.prisma.io/docs/getting-started/setup-prisma/start-from-scratch/relational-databases-typescript-postgres

  1. From official Node.js site download and install Node 17.5.0 32-bit including build tools with Chocolatey on Windows 11 Pro x64
  2. mkdir hello-prisma
  3. cd hello-prisma
  4. npm init -y
  5. npm install prisma typescript ts-node @types/node --save-dev
  6. create tsconfig.json file
  7. npx prisma init
  8. Error: The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set engineType = "binary" in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)
  9. No “schema.prisma” or “.env” files are create.

Expected behavior

A new empty Prisma Node project should be created with a “schema.prisma” file and a “.env” file.

Prisma information

No schema file is create

Environment & setup

  • OS: Windows 11 Pro x64 21H2
  • Database: PostgreSQL
  • Node.js version: v17.5.0 32-bit

Prisma Version

3.9.2

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

I was able to fix this by upgrading to 64 bit Node. For some reason I was using the 32 bit version. I tried using the env variables but they didn’t fix anything.

You can verify your node version by using this command: node -p "process.arch"

I went to the Node website, downloaded the 64 bit installer and installed it again. Didn’t have to remove the 32 bit version first or restart my computer after installing the 64 bit version which was nice. Hope this helps!

If anyone has fixed this, please comment here.

OK, cảm ơn bạn! Sự nhiệt tình của bạn. tôi trân trọng điều đó

Vào Th 6, 20 thg 5, 2022 vào lúc 05:54 Jaime Lozano < @.***> đã viết:

I was able to fix this by upgrading to 64 bit Node. For some reason I was using the 32 bit version. I tried using the env variables but they didn’t fix anything.

You can verify your node version by using this command: node -p “process.arch”

I went to the Node website, downloaded the 64 bit installer and installed it again. Didn’t have to remove the 32 bit version first or restart my computer after installing the 64 bit version which was nice. Hope this helps!

— Reply to this email directly, view it on GitHub https://github.com/prisma/prisma/issues/11781#issuecomment-1132278115, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR3CZEWTVZTKC75KYEUAVBTVK3BBPANCNFSM5OH3CQIA . You are receiving this because you commented.Message ID: @.***>

No creen que tiene que ver el tipo de sistema de 32bit ya que en uno de 64bit no hay ningún problema. Ya que en el mensaje de la terminal aparece así:

Error: The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set `engineType = "binary"` in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)

Ahh, that is a stupid cross dependency of init that we did not think about before. I can reproduce it with similar steps as you provided:

  1. mkdir 11781 && cd 11781
  2. npm init -y && npm install prisma
  3. npx prisma init:
C:\Users\Jan\Documents\throwaway\11781  (11781@1.0.0)
λ npx prisma init
Error: The default query engine type (Node-API, "library") is currently not supported for 32bit Node. Please set `engineType = "binary"` in the "generator" block of your "schema.prisma" file (or use the environment variables "PRISMA_CLIENT_ENGINE_TYPE=binary" and/or "PRISMA_CLI_QUERY_ENGINE_TYPE=binary".)

I can workaround it though by setting the env var: set PRISMA_CLI_QUERY_ENGINE_TYPE=binary:

C:\Users\Jan\Documents\throwaway\11781  (11781@1.0.0)
λ set PRISMA_CLI_QUERY_ENGINE_TYPE=binary

C:\Users\Jan\Documents\throwaway\11781  (11781@1.0.0)
λ npx prisma init

✔ Your Prisma schema was created at prisma/schema.prisma
  You can now open it in your favorite editor.

Next steps:
1. Set the DATABASE_URL in the .env file to point to your existing database. If your database has no tables yet, read https://pris.ly/d/getting-started
2. Set the provider of the datasource block in schema.prisma to match your database: postgresql, mysql, sqlite, sqlserver or mongodb (Preview).
3. Run prisma db pull to turn your database schema into a Prisma schema.
4. Run prisma generate to generate the Prisma Client. You can then start querying your database.

More information in our documentation:
https://pris.ly/d/getting-started

What does your schema.prisma look like that you created manually?

The solution is to install Node 64bits… SOLVED

i dont know

Do you have any resources for me on how to use a Wasm module instead of Query Engine?

Sorry, that was an internal note. We will have to build that Wasm module first 😃

Changing the wording of the error message unfortunately will break it in some of the other locations/variants, so we have a bit of a problem here. For now I am happy you have a workaround that works for you, and this issue works as documentation about that.

We’ll start working on that Wasm module I guess…