nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.45k stars 278 forks source link

Is it possible to use 32-bit-compiled addons on Node.js 64-bit? #4222

Closed VictorQueiroz closed 2 months ago

VictorQueiroz commented 1 year ago

Details

I am trying to use a proprietary library which is a 32-bit library, and whenever I try to import it from Node.js side, it gives me this:

Error: /home/<...>/build/Release/CamTest.node: wrong ELF class: ELFCLASS32
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1340:18)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at bindings (/home/<...>/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/home/<...>/native.js:1:43)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Object.require.extensions.<computed> [as .js] (/home/<...>/node_modules/ts-node/src/index.ts:1608:43) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js version

18 LTS

Example code

No response

Operating system

Arch Linux 64-bit

Scope

C++ 32-bit compiled addon

Module and version

Not applicable.

mhdawson commented 1 year ago

I believe the answer is no and this SO answer seems to agree - https://stackoverflow.com/questions/5720884/load-32-bit-shared-library-from-64-bit-application

github-actions[bot] commented 3 months ago

It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.

github-actions[bot] commented 2 months ago

It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.