-
-
Notifications
You must be signed in to change notification settings - Fork 426
Closed
Description
I was using better-sqlite3 with the version as ^8.3.0
in package.json in my electron app for some time.
On a recent npm install
, better-sqlite3 version 8.6.0 was installed, which causes my app to crash with an error message:
node_modules/better-sqlite3/build/Release/better_sqlite3.node' was compiled against a
different Node.js version using NODE_MODULE_VERSION 108. This version of Node.js
requires NODE_MODULE_VERSION 116.
NOTE: When I switch my version back to 8.4.0
or less, everything works fine
Steps to Reproduce
- Create a sample Electron app (you can clone the quick start project here) or use any existing one
- Install better-sqlite3 version 8.6.0 and electron-rebuild
- Import
better-sqlite3
in main.js and initialize the db:const sqlite = require("better-sqlite3"); const db = sqlite("newdb.sqlite.db") console.log("Created db", db);
- Run the electron app using
npm run start
- See error
Versions
- Node: 18.12.1
- Electron: 24.1.2
- electron-rebuild: 3.3.0
Expected behaviour
No error and the console log is expected
Addition Context
- After using electron-rebuild to rebuild the package (which is the usual case), the process exits without any better-sqlite3 error message:
The crash happens at the bit of code which creates the new db file:
const db = require('better-sqlite3')('myDb.db');
- And the error message is:
node_modules/electron/dist/Electron.app/Contents/MacOS/Electron exited with signal SIGKILL
okunokentaro, liaodalin19903 and jennifer-shehane
Metadata
Metadata
Assignees
Labels
No labels