electron-builder: Bug in release 22.1.0 "[object Object] error Command failed with exit code 1."
Which version of electron-builder are you using?
- Version: 22.1.0
Which version of electron-updater are you using (if applicable)?
- Version: 4.2.0
What target are you building for?
- Target: nsis-web
- package.json:
"build": {
"appId": "com.xxx.yyy",
"productName": "Viewer",
"afterSign": "crv/config/afterSignHook.js",
"directories": {
"output": "build"
},
"nsisWeb": {
"artifactName": "${productName}-Setup-${version}.${ext}",
"oneClick": true,
"perMachine": false,
"allowToChangeInstallationDirectory": false,
"runAfterFinish": true,
"deleteAppDataOnUninstall": true,
"differentialPackage": true
},
"publish": {
"provider": "generic",
"url": "https://www.xxxxx.com/${os}",
"channel": "latest"
},
"files": [
"!apps${/*}",
"!tsconfig.json",
"!tslint.json",
"!yarn-error.log",
"!yarn.lock"
],
"win": {
"extraResources": [
{
"from": "crv/assets/data",
"to": "../",
"filter": "test*"
}
],
"icon": "crv/assets/icons/icon.ico",
"target": [
{
"target": "nsis-web",
"arch": [
"x64",
"ia32"
]
}
]
},
"mac": {
"extraResources": [
{
"from": "crv/assets/data",
"to": "../../../",
"filter": "test*"
}
],
"icon": "crv/assets/icons/icon.icns",
"hardenedRuntime": true,
"gatekeeperAssess": false
}
},
- Error:
$ electron-builder .
• electron-builder version=22.1.0 os=10.0.18362
• loaded configuration file=package.json ("build" field)
• electron-rebuild not required if you use electron-builder, please consider to remove excess dependency from devDependencies
To ensure your native dependencies are always matched electron version, simply add script `"postinstall": "electron-builder install-app-deps" to your `package.json`
• writing effective config file=build\builder-effective-config.yaml
• rebuilding native dependencies dependencies=sqlite3@4.1.0 platform=win32 arch=x64
• rebuilding native dependency name=sqlite3 version=4.1.0
• packaging platform=win32 arch=x64 electron=7.1.1 appOutDir=build\win-unpacked
• rebuilding native dependencies dependencies=sqlite3@4.1.0 platform=win32 arch=ia32
• rebuilding native dependency name=sqlite3 version=4.1.0
• packaging platform=win32 arch=ia32 electron=7.1.1 appOutDir=build\win-ia32-unpacked
• building target=nsis-web file=build\nsis-web\Viewer-Setup-1.0.18.exe archs=x64, ia32 oneClick=true perMachine=false
• building embedded block map file=build\nsis-web\crv-1.0.18-ia32.nsis.7z
• building embedded block map file=build\nsis-web\crv-1.0.18-x64.nsis.7z
⨯ [object Object]
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
ERROR: "run-electron-builder" exited with 1.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
With electron-builder version 21.2.0 everything works fine.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 15
- Comments: 27 (1 by maintainers)
I had to change this line https://github.com/electron-userland/electron-builder/blob/d738644d6e55b027c81e9b7cdd27dc5af9189b0a/packages/app-builder-lib/templates/nsis/include/webPackage.nsh#L20 to fix the build for me. It should be only
${if} ${IsNativeAMD64}I think I just luckily tested out why I got this error in my case. It is weird and you probably can not believe it: I use a 512x512 icon as app icon, and the configuration of
installerIcon&uninstallerIconis using it as default. Turns out I can not use 512x512 icon asinstallerIcon&uninstallerIconFinally, I use 256x256 icon asinstallerIcon&uninstallerIconand leave 512 to the app iconAnd it worked,even on v22.1.0!!!
In my case, some file inside the project folder was using by another program and could not access from the builder. After close the program which using the file the builder works without any problem!
@VeselyT are you familiar with installer scripts? If you tested and it works on your side can you make a PR please?