electron-builder
electron-builder copied to clipboard
ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
I come to you because after several days of research I did not manage to correct this problem, when i try to create an nsis installer. you will find attached my json file is the error. if anyone has an answer to my problem please help me please.
node: v12.18.2 npm: 6.14.5
{ "name": "electron-quick-start", "version": "2.0.0", "description": "A minimal Electron application", "main": "main.js", "repository": { "type": "git", "url": "git+https://github.com" }, "keywords": [ "Electron" ], "author": "GitHub", "license": "CC0-1.0", "devDependencies": { "electron": "^9.1.0", "electron-builder": "^22.0.0" }, "scripts": { "start": "electron .", "pack": "electron-builder --dir", "dist": "electron-builder" }, "build": { "appId": "yourappid", "win": { "target": "NSIS" } } }
electron-builder version=22.7.0 os=10.0.19041 • loaded configuration file=package.json ("build" field) • writing effective config file=dist\builder-effective-config.yaml • packaging platform=win32 arch=x64 electron=9.1.0 appOutDir=dist\win-unpacked • default Electron icon is used reason=application icon is not set • building target=nsis file=dist\electron-quick-start Setup 1.0.0.exe archs=x64 oneClick=true perMachine=false ⨯ C:\Users\C******_M*******\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.4.1\Bin\makensis.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE Output:
Have the same issue here, I need to downgrade to 21.2.0
even with electron-builder version = 21.2.0 the problem persists
Error: C:\Users\M******_C******\AppData\Local\electron-builder\Cache\nsis\nsis-3.0.3.2\Bin\makensis.exe exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
at ChildProcess.
I had the same issue, I moved my app folder to the root of my hard-drive, and it worked. Electron-builder does not seem to be supporting non-ASCII characters in the path of an app.
unfortunately the problem still persists.
@Eole7 Care to elaborate your solution? I am running into the same issue, not very helpful for my CI.
@Eole7 Care to elaborate your solution? I am running into the same issue, not very helpful for my CI.
Well, if you're running the same issue on your CI, my solution might not help you, as I don't have this issue on my CI. Though, the issue I have on local is that when I add the LICENSE key (but from what I've read on other issues, it could be for other reasons) to my NSIS build parameters and that the path of my app contains non-ASCII characters, I get the above error. I moved my app folder to the root directory of my drive and the build was successful.
I had the same problem but only when trying to brand our product with electron-builder
in a linux Debian Buster docker container
The solution that we ended up needing is install wine
and wine32
for i386 arch
node: v10.15.3 npm: 6.4.1 electron-builder: 22.8.0
we simple added these commands to our Dockerfile:
+ dpkg --add-architecture i386 && \
apt-get update && \
apt-get install <LONG_LIST_OF_PACKAGES_WE_NEED> && \
+ apt-get install wine wine32
The part about needing the wine framework is also detailed in the official docs
This error may also appear when you're trying to build the app while some electron process is running (e.g. after improperly closing the dev server).
Open your task manager and make sure you don't have any running electron processes.
Same here. Above comments are looking not related to my case. I don't know what is wrong.
Solved: in my case svg app icon did the issue:
"build": {
"compression": "store",
"asar": "true",
"win": {
"target": "portable",
"icon": "./html/img/logo.svg",
"files": ["**/*", "!html/measurements/*"]
},
"directories": {
"app": "."
}
}
Under Linux it cannot be even jpg as i did for windows. It has to be png.
same here, issue was missing icon
key in build.linux
Yeah, if you look further down the output there should be a more descriptive error. Mine was
Error while loading icon from "C:\...\resources\uninstallerIcon.ico": invalid icon file
I was able to fix it by opening the image in GIMP and re-saving it.
Same for me, wrong icon path. Got to say electron-builder error reporting is quite awful.
这里比较详细:https://juejin.cn/post/6901564623091138567/
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
Still relevant. A missing icon shouldn't produce an unrelated "ERR_ELECTRON_BUILDER_CANNOT_EXECUTE" which is impossible to debug.
On GitHub actions I am getting the following error:
electron-builder install-app-deps
• electron-builder version=22.9.1
• loaded configuration file=package.json ("build" field)
⨯ node_modules.Dependency.Dependencies: ReadMapCB: expect { or n, but found [, error found in #10 byte of ...|ncies" : [],
"main|..., bigger context ...|/garycourt/JSV.git"
}
],
"dependencies" : [],
"main" : "lib/jsv.js",
"keywords" : ["json"|...
Error reading package.json: /home/runner/work/arc-electron/arc-electron/node_modules/JSV/package.json
⨯ /home/runner/work/arc-electron/arc-electron/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE stackTrace=
Error: /home/runner/work/arc-electron/arc-electron/node_modules/app-builder-bin/linux/x64/app-builder exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
at ChildProcess.<anonymous> (/home/runner/work/arc-electron/arc-electron/node_modules/builder-util/src/util.ts:243:14)
at Object.onceWrapper (events.js:422:26)
at ChildProcess.emit (events.js:315:20)
at maybeClose (internal/child_process.js:1048:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
It looks like a file is not being properly read? Not sure why this error is thrown.
getting the same error, no clue what the cause is
@jarrodek please open a separate issue, EB error reporting is certainly bad and your error code is indeed the same, but the issues should probably be triaged separately.
@FrancescoBorzi not sure which error you're referring to. Is it related to icons? GitHub actions? Please elaborate when you have a chance 🙂
@jarrodek please open a separate issue, EB error reporting is certainly bad and your error code is indeed the same, but the issues should probably be triaged separately.
@FrancescoBorzi not sure which error you're referring to. Is it related to icons? GitHub actions? Please elaborate when you have a chance 🙂
I'm getting the same error as the title of this issue report ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
when trying to build my app locally.
My app is: https://github.com/azerothcore/Keira3
reproduction steps: clone the repo, npm install
then npm run electron:mac
(replace mac
with windows
or linux
accordingly).
Do I need to open a separate issue for that?
Same here for https://github.com/blockstack/stacks-wallet/runs/1987721517
I ran into this error as well. Turned out that it didn't like that I had nvm installed (which had somehow caused a weird state where my global npm was missing and I'd needed to install it with yarn). Removing nvm and reinstalling node fixed it for me.
For me the issue was the high resolution of the icns file for the mac icon (1024x1024), and not having specified an icon for the linux build. For the linux version I added a 512x512.png and added it to the linux config, that solved the issue for me.
I had this trouble today. I used the below command for packaging app in package.json
"deploy:win32": npx electron-builder --config ./build/scripts/win32/build-win32.yml
After some tries, I've got the fact I was using the global npm's electron-builder, so I changed the command like below :
"deploy:win32": "./node_modules/.bin/electron-builder --config ./build/scripts/win32/build-win32.yml",
It works fine now anyway.
For me, the cause was using a monorepo in which the package name was @whatever/subrepo
on package.json.
For the linux build, the executable name is taken from there. So the fix for me was
linux: {
executableName: 'simple-name',
},
For me It was because of the last build process I've terminated with CTRL + C.
This was the error code I was getting.
Error output:
Bad text encoding: uninstaller.nsh:1
!include: error in script: "uninstaller.nsh" on line 1
Error in script "<stdin>" on line 165 -- aborting creation process
The solution is just re-install the electron-builder
.
npm uninstall electron-builder -g
npm install electron-builder -g --save-dev
I was having the same problem.
Apparently electron-builder does blind copy without checking if directories in target path exist and doesn't even try to create them, which raises the exception.
I created all the non-existing directories in target path [
For me npm exec electron-builder ...
worked inside the package.json
scripts
If you run npx electron-builder
, electron-builder
will mistakenly use npx
as a package manager and try to use it to install dependencies.