question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Build fails with latest electron-builder version

See original GitHub issue
  • Version: 5.22.13
  • Target: Windows

Steps to Reproduce:

Performing a regular build with

electronize build /target win

fails since the BuildCommand seems to pass invalid CLI arguments to electron-builder.

I’m getting the following output:

C:\Project\obj\desktop\win>electron-builder . --config=./bin/electron-builder.json --platform=win32 --arch=x64
cli.js build
Build
Building:
  --mac, -m, -o, --macos   Build for macOS, accepts target list (see
                           https://goo.gl/5uHuzj).                       [array]
  --linux, -l              Build for Linux, accepts target list (see
                           https://goo.gl/4vwQad)                        [array]
  --win, -w, --windows     Build for Windows, accepts target list (see
                           https://goo.gl/jYsTEJ)                        [array]
  --x64                    Build for x64                               [boolean]
  --ia32                   Build for ia32                              [boolean]
  --armv7l                 Build for armv7l                            [boolean]
  --arm64                  Build for arm64                             [boolean]
  --dir                    Build unpacked dir. Useful to test.         [boolean]
  --prepackaged, --pd      The path to prepackaged app (to pack in a
                           distributable format)
C:\Project\obj\desktop\win>
  --projectDir, --project  The path to project directory. Defaults to current
                           working directory.
  --config, -c             The path to an electron-builder config. Defaults to
                           `electron-builder.yml` (or `json`, or `json5`), see
                           https://goo.gl/YFRJOM
Publishing:
  --publish, -p  Publish artifacts, see https://goo.gl/tSFycD
                [choices: "onTag", "onTagOrDraft", "always", "never", undefined]
Other:
  --help     Show help                                                 [boolean]
  --version  Show version number                                       [boolean]
Examples:
  electron-builder -mwl                     build for macOS, Windows and Linux
  electron-builder --linux deb tar.xz       build deb and tar.xz for Linux
  electron-builder --win --ia32             build for Windows ia32
  electron-builder                          set package.json property `foo` to
  -c.extraMetadata.foo=bar                  `bar`
  electron-builder                          configure unicode options for NSIS
  --config.nsis.unicode=false
Unknown arguments: platform, arch

Please note how the BuildCommand passes arguments for platform and arch to electron-builder, both don’t seem to be supported.

I’ve also noticed that the BuildCommand performs a global installation of electron-builder on each run, which results in always using the latest version. This seems very prone to similar errors like this due to future breaking changes in electron-builder.

Would it be possible to simply install electron-builder locally with a fixed version? That should also solve the problem of it not working on Linux. If you’re OK with that, I’d be happy to provide a PR.

Btw, this is currently totally blocking for me and I don’t have any workarounds😊

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:21 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
GregorBiswangercommented, Jul 26, 2019

I implemented the support for the newest electron-builder. The next update 5.22.14 will support it.

2reactions
GeorgDanglcommented, Jul 11, 2019

@denisHordienko, thanks for the input!

I’ve created PR #289 with the fix. Looking forward to feedback!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Builds failing after upgrading to electron-builder 24.x #7494
npm run package fails with Cannot compute electron version from installed node modules. Downgrading to 23.6.0 works for me. All above fails ......
Read more >
Unable to build app using electron-builder. Error: gyp failed ...
Electron Version : ^10.1.5; Electron Type (current, beta, nightly): Current; Target: Windows. I've installed Python 3.11, node-gyp v8.
Read more >
Common Configuration
Env file electron-builder.env in the current dir (example). Supported only for CLI usage. ... buildVersion String | “undefined” - The build version.
Read more >
Errors with Electron build / Problems / Discussion Area
Hi, Has anything around the Appveyor build system change recently in a way that would cause node native builds to fail as far...
Read more >
Electron builder app is not opening in mac - error "app can't ...
I am trying to build the electron and react app for mac, and once I open the app, I am getting an error...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found