I want to develop desktop app using electron that uses sqlite3 package installed via npm with the command
npm install --save sqlite3
but it
npm install --save sqlite3
npm install --save-dev electron-rebuild
Then, in the scripts of your package.json, add this line:
"scripts": {
"postinstall": "electron-rebuild",
...
},
Then just re-install to trigger the post-install:
npm install
Works flawlessly for me in a complex use case also involving electron-builder, electron-webpack and sequelize.
It works in electron-webpack's dev mode and in production mode for both Windows and Linux.