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.

Node-API library does not work on 32bit Node

See original GitHub issue

Via Azure Functions Windows e2e tests @williamluke4 discovered that our Napi build does not work on 32 bit Node.

image

I can confirm this on Windows directly as well:

[2021-05-03T14:28:26.840Z] Worker process started and initialized.
[2021-05-03T14:28:26.857Z] Worker was unable to load function azure-function-win-e2e-test-2021-05-03-133402: 'Error: \\?\C:\Users\Jan\Documents\prisma2-e2e-tests\platforms-serverless\azure-functions-windows\node_modules\.prisma\client\query_engine_napi-windows.dll.node is not a valid Win32 application.
[2021-05-03T14:28:26.859Z] \\?\C:\Users\Jan\Documents\prisma2-e2e-tests\platforms-serverless\azure-functions-windows\node_modules\.prisma\client\query_engine_napi-windows.dll.node'
[2021-05-03T14:28:26.863Z] Worker failed to function id e5d13d4c-5182-407f-9838-920b085eef0e.
[2021-05-03T14:28:26.865Z] Result: Failure
Exception: Worker was unable to load function azure-function-win-e2e-test-2021-05-03-133402: 'Error: \\?\C:\Users\Jan\Documents\prisma2-e2e-tests\platforms-serverless\azure-functions-windows\node_modules\.prisma\client\query_engine_napi-windows.dll.node is not a valid Win32 application.
[2021-05-03T14:28:26.866Z] \\?\C:\Users\Jan\Documents\prisma2-e2e-tests\platforms-serverless\azure-functions-windows\node_modules\.prisma\client\query_engine_napi-windows.dll.node'
Stack: Error: \\?\C:\Users\Jan\Documents\prisma2-e2e-tests\platforms-serverless\azure-functions-windows\node_modules\.prisma\client\query_engine_napi-windows.dll.node is not a valid Win32 application.
[2021-05-03T14:28:26.868Z] \\?\C:\Users\Jan\Documents\prisma2-e2e-tests\platforms-serverless\azure-functions-windows\node_modules\.prisma\client\query_engine_napi-windows.dll.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (C:\Users\Jan\Documents\prisma2-e2e-tests\platforms-serverless\azure-functions-windows\azure-function-win-e2e-test-2021-05-03-133402\index.js:3:20)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14).

To get to this:

  1. Clone https://github.com/prisma/e2e-tests/tree/enable-napi-tests
  2. Set PRISMA_FORCE_NAPI=true
  3. Run yarn in platforms-servereless/azure-functions-windows
  4. Also run yarn prisma generate and yarn tsc
  5. Make sure you have a 32 bit Node installed, e.g. nvm install 14.16.1 32 and nvm use 14.16.1 32 (uses https://github.com/coreybutler/nvm-windows)
  6. Then run yarn func start and observe error above

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
weavdalecommented, Feb 12, 2022

Any update on running 32bit Node on Windows. I get the 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

I did this and tried npx prisma generate again and still get the same error.

0reactions
janpiocommented, Apr 7, 2022

Same answer as before, the error message includes the workaround. If that workaround does not work for you, open a new issue please.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix npx prisma init error for node 32 - Stack Overflow
When I type npx prisma init I get the follow error: Error: The default query engine type (Node-API, "library") is currently not supported...
Read more >
library not found or failed to load. Trying to use third-party library.
Hi, I am trying to use third-party API. I have placed the .dll file in system32 and sysWOW64 folder as well. I have...
Read more >
Node-API | Node.js v19.3.0 Documentation
Although Node-API provides an ABI stability guarantee, other parts of Node.js do not, and any external libraries used from the addon may not....
Read more >
How to Download & Install Node.js and NPM on Windows
1. Go to the site https://nodejs.org/en/download/ and download the necessary binary files. 2. Double click on the downloaded .msi file to start the...
Read more >
canvas - npm
The minimum version of Node.js required is 6.0.0. Compiling. If you don't have a supported OS or processor architecture, or you use ...
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