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

Node.js start fails on Linux platform due to invalid ELF header error #9058

Closed
zN3utr4l opened this issue May 8, 2024 · 1 comment
Closed

Comments

@zN3utr4l
Copy link

zN3utr4l commented May 8, 2024

I'm trying to create a nodejs app on windows that only runs on linux, when building I install the dependencies like this "SET "npm_config_arch=ia32" ; SET "npm_config_target_arch=ia32" ; SET "npm_config_platform=linux" ; Yarn install" (as suggested here #2221 (comment))

but it goes wrong

/home/pi/test/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:57
throw err;
^

Error: /home/pi/test/node_modules/sqlite3/build/Release/node_sqlite3.node: invalid ELF header
at Module._extensions..node (node:internal/modules/cjs/loader:1452:18)
at Module.load (node:internal/modules/cjs/loader:1197:32)
at Module._load (node:internal/modules/cjs/loader:1013:12)
at Module.require (node:internal/modules/cjs/loader:1225:19)
at require (node:internal/modules/helpers:177:18)
at bindings (/home/pi/test/node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (/home/pi/test/node_modules/sqlite3/lib/sqlite3-binding.js:1:37)
at Module._compile (node:internal/modules/cjs/loader:1356:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1414:10)
at Module.load (node:internal/modules/cjs/loader:1197:32) {
code: 'ERR_DLOPEN_FAILED'
}

Node.js v18.19.1

if I install everything directly on raspberry it obviously works, but I need node_modules to be created on my machine, which is not raspberry

@Daniel15
Copy link
Member

Daniel15 commented May 24, 2024

This is an issue with the "sqlite3" package, not with Yarn If you first installed on a Raspberry Pi, it's possible that node_sqlite3.node is an ARM executable, not an x86-64 one. Try run yarn install again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants