The other day I tried to integrate knex with a SQLITE3 back-end. Unfortunately, the instant I've tried to instantiate knex, I've got a lot of errors. After getting rid of them, I found that I can't get sqlite3 to work at all, even though I've checked the installation and it was OK (got the binary downloaded and even rebuilt it).
Uncaught Error: Cannot find module '/.../node_modules/sqlite3/lib/binding/node-v51-darwin-x64/node_sqlite3.node'
So, here are the steps that I did to make it work:
npm install --save-dev electron-rebuild
install sqlite3 using npm
npm install --save sqlite3
rebuild electron with sqlite3. In
"rebuild": "electron-rebuild -f -w sqlite3"
run the following command
npm run rebuild
Now, you'll get another binding, something like:
which is accepted by electron.