4

So I'm trying to package an electron app using electron-packager. I have followed all the tutorials and have come up with using the following code and then running it in CMD using npm run package-win. When I do this however, nothing happens. It runs the command then hangs here. I have also tried packaging the default electron-forge application. This gets stuck in what I assume is the same place on;

√ Checking your system
| Preparing to Package Application for arch: x64 

What do I have to change to make this work?

{
  "name": "exerunning",
  "version": "1.0.0",
  "description": "",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "package-win": "electron-packager . electron-serialport --overwrite --asar --platform=win32 --arch=ia32 --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"CryptoApp\""
  },
  "author": "Patrick Voorhoeve",
  "license": "ISC",
  "devDependencies": {
    "electron": "^11.1.0",
    "electron-packager": "^15.2.0"
  }
}
  • Have you tried cleaning your cache, and reinstalling your modules.? `npm cache clean --force` `npm install` Sometimes that can help. – Torf Dec 19 '20 at 06:41
  • Just tried doing a cache clear and the problem still persists afterwards. – Patrick Voorhoeve Dec 20 '20 at 03:13
  • I'm also having the same problem. I can't seem to make a windows executable, but I had no problem with it about a month ago. Tried electron-packager version 15.0.0 to see if it would make a difference but no luck. – Ronald C Jan 03 '21 at 10:02

2 Answers2

1

You should have this in your package.json:

"start:electron": "ng build --base-href ./ && electron ."

Then run it; it will update your application status.

After that, run the package command:

npm run package
Adrian Mole
  • 49,934
  • 160
  • 51
  • 83
0

Before trying to run the electron packager command, first, run the command SET DEBUG=* and then run npm run package-win command. It will display the logs in the terminal. There you can find the reason for getting stuck.

I also have faced this issue and found the reason for getting stuck using set debug command.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Chandru
  • 29
  • 6