how do i package knex in my electron app?

I’m answering this question myself because I was able to package it

Firstly, I used "electron-builder": "^22.9.1", instead of electron-packager.

Next, the reason it wasn’t being packaged is because the storage location of my app data wasn’t specified properly.

I was using sqlite database and a json file.

On windows you have make sure it gets saved under APP DATA > your foldername. Electron will handle this automatically if you use

jsonPath = path.join(process.env.APPDATA, "/MyFileName/jsonFile.json");

This should solve any packaging errors you might face.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top