1
votes

I want to create a windows app package from my existing ionic cordova application,I am using electron-packager for the same but getting below error: enter image description here

npm version:5.6.0,electron-packager version: ^11.2.1

I have Added following command in package.json script :

"electron:win": "electron-packager . --platform=win32 --arch=x64 --icon=./assets/icon/favicon.png  --out=./build/win --version-string.CompanyName=Mob --version-string.FileDescription=CE --version-string.ProductName=MobTestApp"

Executing following :

npm run electron:win

after command

ionic cordova build windows

And I have referred to : Electron Packager - set App Icons for OSX & Windows also I have followed this tutorial for the same: https://www.christianengvall.se/electron-packager-tutorial/

I am unable to understand cause of error. Can anyone please help me to resolve the issue?

Edited :

Now i have progressed from the error which i was getting while creating a package and used a command:

electron-packager ./src --platform=win32 --arch=ia32  --out=./build/win6 --version-string.CompanyName=Mob --version-string.FileDescription=CE --version-string.ProductName=MobTestApp

to create a package for windows build, and created a successful package for the same but whenever I try to run the app .exe file getting error as : enter image description here

What should I do resolve the error and create a successful build for windows using electron?

1

1 Answers

0
votes

I was unable to resolve the electron-packager issue due to the dependencies on internally distributed plugins and packages. After trying multiple options I found "electron-builder" useful to create successful build of ".exe" and ".appx" for windows.

Requirements :

  1. NodeJS version should be more than 8.0.

  2. If you have any internally distributed package dependencies then please make sure to add them in package.json file in build.extraFiles like:

    { "build": { "extraFiles": [ "node_modules/module-name/**/*" ] }}

  3. For more information I found this useful: Check this