TryGhost / node-sqlite3

SQLite3 bindings for Node.js
BSD 3-Clause "New" or "Revised" License
6.23k stars 817 forks source link

node-sqlite3 package not supported for Cross platform #1791

Open krishnashravtek opened 6 months ago

krishnashravtek commented 6 months ago

Issue Summary

I'm using the node:sqlite3 package in a cross-platform application. After compiling the application on a Linux machine for a winx64 platform, the executable file throws an error on the Windows machine.

When installing the package, I only get the binary for the platform I install. So the target platform couldn't launch the binary and throws node_sqlite3.node is not a valid Win32 application.

Yeah, I can remove the node_modules directory, reinstall the dependency, and compile on the Win32 itself.

THat should work.

But I can't repeat the compiling for every platform with a different arch.

Is there a way for me to install dependencies on my Linux computer and compile for a different platform?

Relevant logs or output

pkg/prelude/bootstrap.js:1872 throw error; ^

Error: C:\Users\Dell\AppData\Local\Temp\pkg\c9bd0419f77efb3b5d3a691fda04e265f740ad8dc195f0b56003cdeac92e9a34\lin-sqlite3\build\Release\node_sqlite3.node is not a valid Win32 application. C:\Users\Dell\AppData\Local\Temp\pkg\c9bd0419f77efb3b5d3a691fda04e265f740ad8dc195f0b56003cdeac92e9a34\lin-sqlite3\build\Release\node_sqlite3.node at process.dlopen (pkg/prelude/bootstrap.js:2251:28) at Object.Module._extensions..node (node:internal/modules/cjs/loader:1189:18) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at Module.require (pkg/prelude/bootstrap.js:1851:31) at require (node:internal/modules/cjs/helpers:102:18) at bindings (C:\snapshot\hyzignServer\node_modules\bindings\bindings.js:112:48) at Object. (C:\snapshot\hyzignServer\node_modules\lin-sqlite3\lib\sqlite3-binding.js:1:99) at Module._compile (pkg/prelude/bootstrap.js:1926:22) { code: 'ERR_DLOPEN_FAILED' }

Version

V5.1.7

Node.js Version

v16.20.2

How did you install the library?

with npm