3

I am trying to package my app with electron-packager. My app have as dependencies sqlite3 and sequelize.

here is my package.json file :

{
  "name": "electronjs_base",
  "version": "1.0.0",
  "description": "Projet de base Electron JS",
  "main": "main.js",
  "scripts": {
    "start": "electron main.js",
    "test": "echo \"Error: no test specified\" && exit 1",
    "postinstall": "install-app-deps",
    "rebuild": "electron-rebuild -f -w sqlite3"
  },
  "author": "Aurélien Colombet & Steven Servanton",
  "license": "ISC",
  "devDependencies": {
    "electron": "^4.0.3",
    "electron-builder": "^20.38.5",
    "electron-packager": "^13.0.1",
    "electron-rebuild": "^1.8.2"
  },
  "dependencies": {
    "cors": "^2.8.5",
    "ejs": "^2.6.1",
    "electron-reload": "^1.4.0",
    "express": "^4.16.4",
    "formidable": "^1.2.1",
    "fs": "0.0.1-security",
    "path": "^0.12.7",
    "sequelize": "^4.42.0",
    "sqlite3": "^4.0.6"
  }
}

I am on linux and I am trying to build my app for windows. I use electron-packager for that, with that command :

electron-packager . gamemaster_interface --overwrite --platform=win32 --arch=x64 --out=release-builds

My app works well on linux when I launch it with npm run start, but when I am trying to run it on windows with the executable file created by electron-packager I have a javascript error :

Exception raise when launching windows executable

I don't know how to solve that problem, I have trying multiple things like adding sqlite3 in devDependencies instead of dependencies in the package.json but I still have the error.

Thank you for reading me and I hope someone have the solution :).

Have a nice day !

Buisson
  • 479
  • 1
  • 6
  • 23
  • I have also faced same issue.I downloaded sqlite3 node module on a windows machine and then re-builded it on the same machine. Then I used this node module to package the application. – Sajin Jan 31 '19 at 09:09
  • Finally we made the ".exe" file from windows machine itself. Some node modules builded on one operating system might not work on other. You can ping me for any help. – Sajin Jan 31 '19 at 09:19
  • Yes thanks for the answer, but I want to make it work because I will install that application on multiple machine and I don't want to rebuild my app every time I will install an app :/. – Buisson Jan 31 '19 at 09:33
  • I build my app on windows and when I execute the .exe from another computer with windows it works. So the solution is to build the app on a windows computer. But I am still curious to know if it is possible to make it works on linux :). – Buisson Jan 31 '19 at 14:04

0 Answers0