3

goal

I want to build an electron app ON a windows Machine for a Rasperry PI 4 running Raspbian32

configuration

"linux": { "target" : [ { "target": "AppImage", "arch": ["armv7l"] } ] }, 

calling

"build-dist-lin": "webpack --mode production && electron-builder -l --config .env.json",

returned ERROR

cannot get, wait error=Get "https://service.electron.build/find-build-agent?no-cache=1ghlrte": dial tcp 51.15.76.176:443: connectex: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. attempt=0 waitTime=2 Error: C:\A\Repo\test\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE

No Leads

There is no further information in this log to know where then ... it goes wrong. In the same env.json I also have a Windows Configuration part which runs perfectly well with calling it with -w. So that means that the configuration is probably ok. And that means it fails somewhere else.

full log:

 0 info it worked if it ends with ok 1 verbose cli [ 1 verbose cli 'C:\\A\\Tools\\nodejs\\node.exe', 1 verbose cli 'C:\\A\\Tools\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'run', 1 verbose cli 'build-dist-lin' 1 verbose cli ] 2 info using [email protected] 3 info using [email protected] 4 verbose run-script [ 'prebuild-dist-lin', 'build-dist-lin', 'postbuild-dist-lin' ] 5 info lifecycle [email protected]~prebuild-dist-lin: [email protected] 6 info lifecycle [email protected]~build-dist-lin: [email protected] 7 verbose lifecycle [email protected]~build-dist-lin: unsafe-perm in lifecycle true 8 verbose lifecycle [email protected]~build-dist-lin: PATH: C:\A\Tools\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\A\Repo\testingtestplayer\node_modules\.bin;C:\Python27\;C:\Python27\Scripts;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\WINDOWS\System32\OpenSSH\;C:\a\tools\nodejs\;C:\ProgramData\chocolatey\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\dotnet\;C:\a\tools\Git\cmd;C:\Users\edward.deleau\AppData\Local\Microsoft\WindowsApps;C:\a\tools\Microsoft VS Code\bin;C:\Users\edward.deleau\AppData\Roaming\npm;C:\Users\edward.deleau\.dotnet\tools;C:\Users\edward.deleau\.dotnet\tools 9 verbose lifecycle [email protected]~build-dist-lin: CWD: C:\A\Repo\testingtestplayer 10 silly lifecycle [email protected]~build-dist-lin: Args: [ 10 silly lifecycle '/d /s /c', 10 silly lifecycle 'webpack --mode production && electron-builder -l --config .env.json' 10 silly lifecycle ] 11 silly lifecycle [email protected]~build-dist-lin: Returned: code: 1 signal: null 12 info lifecycle [email protected]~build-dist-lin: Failed to exec build-dist-lin script 13 verbose stack Error: [email protected] build-dist-lin: `webpack --mode production && electron-builder -l --config .env.json` 13 verbose stack Exit status 1 13 verbose stack at EventEmitter.<anonymous> (C:\A\Tools\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16) 13 verbose stack at EventEmitter.emit (events.js:311:20) 13 verbose stack at ChildProcess.<anonymous> (C:\A\Tools\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14) 13 verbose stack at ChildProcess.emit (events.js:311:20) 13 verbose stack at maybeClose (internal/child_process.js:1021:16) 13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) 14 verbose pkgid [email protected] 15 verbose cwd C:\A\Repo\testingtestplayer 16 verbose Windows_NT 10.0.18362 17 verbose argv "C:\\A\\Tools\\nodejs\\node.exe" "C:\\A\\Tools\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "build-dist-lin" 18 verbose node v12.16.1 19 verbose npm v6.13.4 20 error code ELIFECYCLE 21 error errno 1 22 error [email protected] build-dist-lin: `webpack --mode production && electron-builder -l --config .env.json` 22 error Exit status 1 23 error Failed at the [email protected] build-dist-lin script. 23 error This is probably not a problem with npm. There is likely additional logging output above. 24 verbose exit [ 1, true ] 

2 Answers 2

5

Seems to be an issue with the electron builder. Since the free service host associated with the electron builder is unavailable and there by it refuses the connection. You could monitor the issue thread from the below link. This issue has been watched along for a long time I believe.

https://github.com/electron-userland/electron-builder/issues/3569

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, it seems that this is indeed the reason, though not a good reason. So im looking for an alternative. I manage to build on a rasbian32 pi 4 myself. But since this code goes to a windows based teamcity build server... my problem is that the sqlite extension does require a local compilation. So a cross-build on Ubuntu will fail because the call to electron-builder will call the "after-builds" but this will compile against x64 instead of armv7.
3

Unfortunately it doesn't seem that such issue will be fixed anytime soon, as we can see from the amount of (mostly open) GitHub issues that have been opened from users that are trying to deal with such problem in the past months:

That said, I used the following workarond using Docker that made me able to build a Linux redistributable .deb package for my Electron App from Windows 10 in less than 5 minutes:

docker pull electronuserland/builder

  • From the Electron project's root folder (such as C:\MyApp), type the following command-line command to run the container and map the Electron project's root folder to the /project virtual path:

docker run -rm -ti -v C:\MyApp\:/project -w /project electronuserland/builder

  • From inside the container, type the following commands to upgrade the Electron project's Yarn packages, globally install the electron-builder package and build the Linux redistributable package:

cd /project

yarn upgrade

yarn global add electron-builder

electron-builder -l

If everything went smooth, you should be able to locate your MyApp.deb file (or rpm, AppImage, or anything you've configured within the electron-builder's package.json file) inside the Electron project's /dist/ folder.

For further info about this whole procedure and a bit of background, check out this post on my blog.

2 Comments

Useful answer and blog, thank you, it worked. For some reason though, this broke my windows build script (said 'electron-builder' is not recognized as an internal or external command).
Fixed above by deleting node_modules followed by npm install

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.