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

fails to run in pkg-generated program #1658

Open
pedefe opened this issue Nov 21, 2022 · 1 comment
Open

fails to run in pkg-generated program #1658

pedefe opened this issue Nov 21, 2022 · 1 comment

Comments

@pedefe
Copy link

pedefe commented Nov 21, 2022

Issue Summary

On arm64 proc. computer:

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
  1. 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

[email protected]

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

@cyqsimon
Copy link

cyqsimon commented Aug 1, 2024

Ran into basically this today.

All you need to do is to bundle the complied native libraries and bindings into the executable. You can do so via configuring pkg in your package.json, something like this:

{
  // ... other fields
  "pkg": {
    "assets": [
      "node_modules/sqlite3/lib/**",
    ]
  },
}

SEO

The specific error I got was "Error: Please install sqlite3 package manually".

Related issues:

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

No branches or pull requests

2 participants