1
votes

I'm trying to build an Electron app using Azure DevOps. It fails with the following error:

Package Electron App for Platform win...
  • electron-builder  version=21.2.0 os=4.15.0-1052-azure
  • artifacts will be published if draft release exists  reason=CI detected
  • loaded configuration  file=/home/vsts/work/1/s/FotoManager/obj/desktop/win/bin/electron-builder.json
  • packaging       platform=win32 arch=x64 electron=5.0.8 appOutDir=/home/vsts/work/1/s/FotoManager/bin/Desktop/win-unpacked
  • downloading     url=https://github.com/electron/electron/releases/download/v5.0.8/electron-v5.0.8-win32-x64.zip size=59 MB parts=4
  • downloaded      url=https://github.com/electron/electron/releases/download/v5.0.8/electron-v5.0.8-win32-x64.zip duration=1.859s
  • downloading     url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.5.0/winCodeSign-2.5.0.7z size=5.6 MB parts=1
  • downloaded      url=https://github.com/electron-userland/electron-builder-binaries/releases/download/winCodeSign-2.5.0/winCodeSign-2.5.0.7z duration=1.593s
  ⨯ wine is required, please see https://electron.build/multi-platform-build#linux  
/usr/local/lib/node_modules/electron-builder/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE  stackTrace=
    Error: /usr/local/lib/node_modules/electron-builder/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
        at ChildProcess.childProcess.once.code (/usr/local/lib/node_modules/electron-builder/node_modules/builder-util/src/util.ts:239:14)
        at Object.onceWrapper (events.js:286:20)
        at ChildProcess.emit (events.js:198:13)
        at maybeClose (internal/child_process.js:982:16)
        at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
    From previous event:
        at runCallback (timers.js:705:18)
        at tryOnImmediate (timers.js:676:5)
        at processImmediate (timers.js:658:5)
    From previous event:
        at WinPackager.signApp (/usr/local/lib/node_modules/electron-builder/node_modules/app-builder-lib/src/winPackager.ts:357:27)
        at WinPackager.doPack (/usr/local/lib/node_modules/electron-builder/node_modules/app-builder-lib/src/platformPackager.ts:243:16)
... done

A local build on Win10 works without any problem.

This is my pipeline YAML: https://github.com/mu88/BlazorFotoManager/blob/master/azure-pipelines.yml

As you can see, I'm installing Wine, as recommended here.

Any ideas how to solve that?

2

2 Answers

2
votes

Finally, I solved it by simply using a Windows VM Image.

0
votes

This error can occur on all CI Pipelines. I faced it on GitLab CI, since it builds it on a Linux machine.

The solution in GitLab CI was to use the image electronuserland/builder:wine as recommended in the official docs

Example .gitlab-ci.yml file