0

After I package an electron app with electron-packager using this commande from npm scripts :

electron-packager . Gestion-ecole-sportive 
--overwrite --platform=win32 --arch=ia32 --asar
--icon=assets/image/icons/conApp.ico --prune=true 
--out=release-builds --version-string.CompanyName=CE 
--version-string.FileDescription=CE 
--version-string.ProductName="Gestion d'école sportive"

Knowing that it's the same machine that I build the app on it, and it was working fine in the development process

And when I start the app, it's shows, but I found an error of sqlite3 in the console of the dev tools :

Uncaught Error: Please install sqlite3 package manually

and it's coming from sequelize configuration line code :

sequelize = new Sequelize({
  dialect: 'sqlite',
  storage: 'config/db/db_ecole.db'
})

devDependencies and dependencies :

"devDependencies": {
    "electron": "^5.0.8",
    "electron-packager": "^14.0.6",
    "electron-rebuild": "^1.8.5",
    "node-gyp": "^5.0.3"
  },
  "dependencies": {
    "bootstrap": "^4.3.1",
    "datatables.net-bs4": "^1.10.19",
    "exceljs": "^2.0.1",
    "gijgo": "^1.9.13",
    "jquery": "^3.4.1",
    "popper": "^1.0.1",
    "popper.js": "^1.14.7",
    "sequelize": "^5.19.0",
    "sqlite3": "^4.0.9"
  }
D. Ahmed
  • 345
  • 1
  • 3
  • 18

1 Answers1

0

Maybe you can try an electron rebuild? Something along the lines of:

./node_modules/.bin/electron-rebuild -w sqlite3

Hopefully that helps!

Nathan
  • 7,853
  • 4
  • 27
  • 50
  • Should I run this line befor the electron-packager ? – D. Ahmed Sep 29 '19 at 20:36
  • 1
    Yea try running this command independently. Also, check out this link as well: https://www.npmjs.com/package/sqlite3#custom-builds-and-electron – Nathan Sep 30 '19 at 14:05
  • I tried but unfortunately it didn't work, but I found this [answer](https://stackoverflow.com/a/50262876/8665772) and I used electron-builder instead, because it build the sqlite module while packaging the electron app, and also give an .exe installer for windows – D. Ahmed Oct 01 '19 at 12:09