Electron app cant find sqlite3 module Electron app cant find sqlite3 module sqlite sqlite

Electron app cant find sqlite3 module


Firstly:

npm install electron-rebuild

then try this several times:

./node_modules/.bin/electron-rebuild -w sqlite3 -p


You have to build this native module with Electron based configurations.

Try:
1. cd node_modules/sqlite3
2. npm run prepublish
3. node-gyp configure --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.3-win32-x64
4. node-gyp rebuild --target=1.3.1 --arch=x64 --target_platform=win32 --dist-url=https://atom.io/download/atom-shell --module_name=node_sqlite3 --module_path=../lib/binding/electron-v1.3-win32-x64

This is assuming you have the very latest version of electron. You can change the config to match your electron version.


If none of these are working try this.

npm install electron-builder

Add this in your script tag of package.json file

 "postinstall": "electron-builder install-app-deps"

Then execute this

npm run postinstall 

This saved a lot of my time