I’m using electron forge, React and sqlite3 with node.js, and after i tried to make the app: “npm run make” the app works fine, but can’t find the sqlite3 module, so my database don’t work. He keeps giving me this error:
Uncaught (in promise) Error: Cannot find module ‘/native_modules/build/Release/node_sqlite3.node’
Require stack:
- C:UsersCaio_AppDataLocalstorage_handlerapp-1.0.0resourcesapp.asar.webpackrenderermain_windowindex.html
My working tree:
enter image description here
After the “npm run make”:
enter image description here
I noticed the file where the database should be is now an .asar file (it’s located inside the resources directory). I tried somethings that i found on the internet, but couldn’t solve it, like using electron-rebuild. Anybody has any ideia of what should i do to make my electron app find the sqlite3 module?
(Sorry for the bad english, i’m not native)
Caio Henrique is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.