Akash Pande
Akash Pande

Reputation: 31

electron sqlite3 Uncaught Error: Cannot find module

I have built an electron app in Mac OS, when I try to export the package for windows and try to run it throws me following error:

Error Screenshot

My app uses sqlite3, I installed sqlite using following command:

npm install sqlite3 --build-from-source

My NODE_PATH is also set to the node_modules folder, also tried following commands:

npm install --save-dev electron-rebuild

# Every time you run "npm install", run this
./node_modules/.bin/electron-rebuild

But still I am not able to run sqlite3 on windows with electron

Upvotes: 3

Views: 1911

Answers (1)

Vadim Macagon
Vadim Macagon

Reputation: 14847

sqlite3 relies on node-pre-gyp, so you need to use the workaround provided in electron-rebuild when building sqlite3 for Electron.

Upvotes: 0

Related Questions