node-sqlite3
node-sqlite3 copied to clipboard
fails to run in pkg-generated program
Issue Summary
On arm64 proc. computer:
- install of [email protected] succeeds;
- install of [email protected] succeeds;
- generate program with pkg succeeds: pkg -t node12-linux-arm64 index.js -o prog_name
When running program, fails when loads sqlite3.
Relevant logs or output
include sqlite3... pkg/prelude/bootstrap.js:1876 throw error; ^
Error: Cannot find module '/snapshot/NexoManager/node_modules/sqlite3/lib/binding/napi-v6-linux-glibc-arm64/node_sqlite3.node' Require stack:
- /snapshot/NexoManager/node_modules/sqlite3/lib/sqlite3-binding.js
- /snapshot/NexoManager/node_modules/sqlite3/lib/sqlite3.js
- /snapshot/NexoManager/index.js
- If you want to compile the package/file into executable, please pay attention to compilation warnings and specify a literal in 'require' call. 2) If you don't want to compile the package/file into executable and want to 'require' it from filesystem (likely plugin), specify an absolute path in 'require' call using process.cwd() or process.execPath.
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
at Function._resolveFilename (pkg/prelude/bootstrap.js:1955:46)
at Function.Module._load (internal/modules/cjs/loader.js:667:27)
at Module.require (internal/modules/cjs/loader.js:887:19)
at Module.require (pkg/prelude/bootstrap.js:1855:31)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.
(/snapshot/NexoManager/node_modules/sqlite3/lib/sqlite3-binding.js:4:17) at Module._compile (pkg/prelude/bootstrap.js:1930:22) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) { code: 'MODULE_NOT_FOUND', requireStack: [ '/snapshot/NexoManager/node_modules/sqlite3/lib/sqlite3-binding.js', '/snapshot/NexoManager/node_modules/sqlite3/lib/sqlite3.js', '/snapshot/NexoManager/index.js' ], pkg: true }
Version
Node.js Version
root@bionic-newport:/var/prog# node -v : v12.21.0
How did you install the library?
npm install node-pre-gyp --force --save --unsafe-perm npm install sqlite3 --force --save --unsafe-perm