node-sqlite3
node-sqlite3 copied to clipboard
Unable to do Cross-Platform compilation
Issue Summary
I've been testing my application with MacOS, but when I try to deploy my application in a cloud function which is running on linux and x64 architecture I'm getting the invalid ELF header error.
I've tried the following
- Installing with
--os linux --cpu x64options - Rebuild with
--os linux --cpu x64options - Installing with
--build-from-source --os linux --cpu x64options
but there's seems to be no change. Even when I try to test the application after running the above install/rebuild commands the application works fine in local machine (MacOS), and when I deploy the same to cloud functions it doesn't work and throws the invalid ELF header error.
The same works perfectly fine when I install the sqlite3 package from a linux machine and deploy it to the cloud function.
Am I missing something here when trying to install the package specific to an OS ?
Relevant logs or output
Error: /catalyst/node_modules/sqlite3/build/Release/node_sqlite3.node: invalid ELF header
at Module._extensions..node (node:internal/modules/cjs/loader:1454:18)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Module.require (node:internal/modules/cjs/loader:1233:19)
at require (node:internal/modules/helpers:179:18)
at bindings (/catalyst/node_modules/bindings/bindings.js:112:48)
at Object.
Version
5.1.7
Node.js Version
v20.16.0
How did you install the library?
npm install