electron / electron/rebuild

electron is not picking up electron-build's sqlite3

Open
#314 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.1k
Forks
181
Avg merge
6h 44m
Merged PRs (30d)
3

Description

electron: 6.0.0
electron-rebuild: 1.8.5
sqlite3: 4.0.9

After running `electron-rebuild`, I will get the following error when I try to launch Electron:
```sh
App threw an error during load
Error: Cannot open **/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node: Error: The module '**/node_modules/sqlite3/lib/binding/node-v72-darwin-x64/node_sqlite3.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 70. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
```

After looking into a bit, it appears `electron-rebuild` is creating the binding for sqlite3 in a directory `node_modules/sqlite3/lib/binding/electron-v6.0-darwin-x64/`. However, for some reason Electron is looking at `node_modules/sqlite3/lib/binding/node-v72-darwin-x64/` instead.

To work around the issue, I replaced the `node_sqlite3.node` binding in `node-v72-darwin-x64` with the one from `electron-v6.0-darwin-x64`. This allowed me to launch Electron.

Is this a bug or do I need to configure something that makes Electron pick up the correct bindings?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.