Electron App Getting Exception While requiring SQLITE3 Electron App Getting Exception While requiring SQLITE3 sqlite sqlite

Electron App Getting Exception While requiring SQLITE3


it seems you have many problems with your scripts, but you also encountered a rare issue with sqlite.

0) You can find my Github source here that is working until this error :

Cannot read property 'on' of undefined

but that is another problem :D

1) Your package.json is not well formated (there is no start script for example)

New package.json

{ // there was no begining bracket  "name": "billingapp",  "version": "1.0.0",  "description": "",  "main": "index.js",  "scripts": {    "rebuild": "electron-rebuild -f -w billingapp",    "start": "node index.js" // new start script  },  "author": "S Kundu",  "license": "ISC",  "dependencies": {    "electron": "^1.7.11",    "sqlite3": "^3.1.0" // I used this version  },  "devDependencies": {    "electron-rebuild": "^1.7.3"  }}

2) When I installed sqlite I encountered this issue https://github.com/mapbox/node-sqlite3/issues/758

It seems sqlite3 is not working with the last version of nodejs, so you need to install node@8.9.3 you can use nvm for that:

see comment on sqlite3 issue

treedbox commented on 20 Dec 2017