electron-builder: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE
I’m not able to generate builds for MacOs, I’ve made several attempts to change versions and the error persists:
⨯ hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE stackTrace= Error: hdiutil exited with code ERR_ELECTRON_BUILDER_CANNOT_EXECUTE at ChildProcess.<anonymous> (/.../node_modules/builder-util/src/util.ts:243:14) at Object.onceWrapper (events.js:417:26) at ChildProcess.emit (events.js:310:20) at maybeClose (internal/child_process.js:1021:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
I did the tests with the following combinations electron-builder: 20.36.2 electron: 3.0.9
electron-builder: 21.1.6 electron: 7.15.0
electron-builder: 21.1.5 electron: 5.0.8
and also with the latest version for both electron-builder: 22.9.1 electron: 11.0.2
All tests were done using a Macbook Air Catalina version 10.15.7 and Node version 12.16.3. Sometimes I have some success using debug mode with DEBUG=electron-builder node_modules/.bin/electron-builder build -m
Additional information: I do not use any kind of antivirus.
Please help me, I create a big project but in every version released I have problems building versions for MacOs.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 5
- Comments: 43 (14 by maintainers)
Commits related to this issue
- fix(mac): Workaround for hdiutil randomly failing (#5431) For unknown reasons hdiutil fails randomly when trying to create the dmg in the tmp location. This workaround simply retries until it works o... — committed to chokladmal/electron-builder by chokladmal 4 years ago
- fix(mac): Workaround for hdiutil randomly failing (#5431) (#5464) * fix(mac): Workaround for hdiutil randomly failing (#5431) For unknown reasons hdiutil fails randomly when trying to create the d... — committed to electron-userland/electron-builder by chokladmal 3 years ago
- Bump app-builder-lib from 22.9.1 to 22.10.5 in /desktop (#2072) Summary: allow-large-files Bumps [app-builder-lib](https://github.com/electron-userland/electron-builder) from 22.9.1 to 22.10.5. <deta... — committed to facebook/flipper by dependabot[bot] 3 years ago
- Bump electron-builder from 22.9.1 to 22.10.5 in /desktop (#2068) Summary: Bumps [electron-builder](https://github.com/electron-userland/electron-builder) from 22.9.1 to 22.10.5. <details> <summary>Re... — committed to facebook/flipper by dependabot[bot] 3 years ago
This worked for me, thanks.
On Ventura 13.0.1 managed to solve it by allowing application (in my case the terminal I was using to run the build) to update or delete other applications. It is in Privacy & Security -> App Management.
I would suggest the Full Disc Access, as well, for Terminal.
Since updating to Big Sur 11.3.1 I am receiving this same error message and I am unable to build a dmg file.
Xcode: Version 12.5 (12E262) Python: 2.7.16 electron: “~11.4.5” electron-builder: “^22.11.1”
just kill terminal and start fresh one i am sure it will work
Closing per comment above 🙂
I’m having this issue too, tried all suggestions mentioned above but none helped. The first time I tried building, everything went smoothly and I got all the output formats. Strange that it worked the first time but not anymore. I also tried wiping the
node_modulesanddistfolders but no luck.Unfortunately, I’m still seeing this issue. I’ve tried disabling spotlight and giving terminal permissions possible.
MacOS: 12.3/12.3.1 electron-builder: 22.14.13 Intel Mac
Hey all, yesterday I did some tests and running this command
sudo mdutil -a -i offit works !!!This may be a PROBLEM of BigSur system.
Adding the DEBUG_DMG=true env to the process could check out the ERROR.
In my case, the outputted ERROR was Operation not permitted when
hdiutil createwhich is first step for creating dmg file.SOLUTION: removing this line will always works well.
The
-fsis one of HFS+, HFS+J (JHFS+), HFSX, JHFS+X, MS-DOS, or UDF. -fs causes a filesystem of the specified type to be written to the image. -fs can change the partition scheme and type appropriately. -fs will not make any size adjustments: if the image is the wrong size for the specified filesystem, create will fail. -fs is invalid and ignored when using -srcdevice.We know that “hdiutil create”, when it fails, always fail due to failing to unmount (resource busy). Why that is is hard to say though. Could perhaps be antivirus or something else touching the files while the volume is mounted as has been suggested before. I can’t really tell if that’s the case. It seems to succeed eventually if retrying. For me that seldom requires more than three attempts.
I’ve tried running it in isolation quite a few times now with about the same result: it sometimes succeeds and sometimes fail. The success-error ratio seems to be much better though with failures happening less than half the time.
And the obvious thing that I should have tried from the beginning: running hdiutil with -debug
@EdmarPereira Looks like it might be related to what you had discovered before. The debug output reveals some unmounting problems:
and
and finally