electron is not picking up electron-build's sqlite3
- 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
Assessment
This issue has not been assessed yet.