rebuild
rebuild copied to clipboard
electron is not picking up electron-build's sqlite3
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:
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?
I've had this too with the same workaround.
add resolutions props in your project package.json
"resolutions": { "**/node-abi": "^2.11.0" },
because node-abi is supported electron6.x on version 2.10.0