Electron-builder: Mac build failing with spawn hdiutil ENOENT

Created on 10 Oct 2016  Â·  11Comments  Â·  Source: electron-userland/electron-builder

  • electron: 1.4.3
  • electron-builder: 7.11.4
  • build platform: linux
  • target platform: mac

Trying to build my trial 'hello world' app for Mac, I get the following error:

> [email protected] build .../electron-koa-app
> build "--mac" "--x64"

Skip app dependencies rebuild because platform is different
Packaging for platform darwin x64 using electron 1.4.3 to dist/mac

Creating DMG
Creating MacOS zip
Error: Exit code: ENOENT. spawn hdiutil ENOENT
    at .../electron-koa-app/node_modules/electron-builder/src/util/util.ts:102:16
    at exithandler (child_process.js:213:5)
    at ChildProcess.errorhandler (child_process.js:225:5)
    at emitOne (events.js:96:13)
    at ChildProcess.emit (events.js:188:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:213:12)
    at onErrorNT (internal/child_process.js:359:16)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
From previous event:
    at Object.exec (.../electron-koa-app/node_modules/electron-builder/src/util/util.ts:80:3)
    at DmgTarget.<anonymous> (.../electron-koa-app/node_modules/electron-builder/src/targets/dmg.ts:49:15)
    at next (native)
    at .../electron-koa-app/node_modules/graceful-fs/graceful-fs.js:99:16
    at .../electron-koa-app/node_modules/graceful-fs/graceful-fs.js:43:10
    at FSReqWrap.oncomplete (fs.js:123:15)
From previous event:
    at tsAwaiter (.../electron-koa-app/node_modules/electron-builder/src/util/awaiter.ts:10:47)
    at DmgTarget.build (.../electron-koa-app/node_modules/electron-builder/out/targets/dmg.js:20:16)
    at MacPackager.packageInDistributableFormat (.../electron-koa-app/node_modules/electron-builder/src/macPackager.ts:195:25)
    at nonMasPromise.doPack.then.then (.../electron-koa-app/node_modules/electron-builder/src/macPackager.ts:80:16)
From previous event:
    at MacPackager.<anonymous> (.../electron-koa-app/node_modules/electron-builder/src/macPackager.ts:79:10)
    at next (native)
From previous event:
    at tsAwaiter (.../electron-koa-app/node_modules/electron-builder/src/util/awaiter.ts:10:47)
    at Object.build (.../electron-koa-app/node_modules/electron-builder/out/builder.js:138:12)
    at Object.<anonymous> (.../electron-koa-app/node_modules/electron-builder/out/build-cli.js:23:11)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)
    at Function.Module._load (module.js:424:3)
    at Module.runMain (module.js:590:10)
    at run (bootstrap_node.js:394:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:509:3

Am I doing something wrong, or is there a bug?

question

Most helpful comment

You can build mac dmg only on macOS. Please see https://github.com/LinusU/node-appdmg/issues/14#issuecomment-244538777

All 11 comments

You can build mac dmg only on macOS. Please see https://github.com/LinusU/node-appdmg/issues/14#issuecomment-244538777

Ok, thanks.

@develar Quick question about it, today there's a warning message "macOS application code signing is supported only on macOS, skipping.", yet even though it "skipped" this step, which is fine by me, it still throws the same error.
Can we suppress the error in such cases? I'm okay with the application not being signed and I want the options to still use electron-builder for mac, same as I do for win and linux, and not separate the three.

@iMoses Sorry, not clear for me what do you mean. What error is thrown? spawn hdiutil ENOENT? In this case you can set another target.

@develar Yes, the error I'm referring to is spawn hdiutil ENOENT.
What do you mean by setting another target? As in, not Mac?
I'm not even sure why this error occurs.

@iMoses By default electron-builder builds for current platform and for current arch. So, I don't understand your problem. If you want to produce only zip / tar.gz — please set corresponding target .

@develar Sorry, I should have provided more details to make my question clearer. But anyhow, your answer gave me the clue I needed. I didn't notice that I can provide the target type, I thought it automatically chooses the target according to the configuration.
"build --mac tar.gz" did the try for me, now I don't get the error.
Thanks!

@iMoses To avoid CLI arg, you can simply:

"mac": {
  "target": "tar.gz"
}

in the configuration.

@develar correct me if I'm wrong, but shouldn't #14 fix this? The whole point of the the PR was to allow building dmg on linux. Have I missed something?

Oh, damn. If only I could build from Linux. Would make integrating with CI server so easy. Anyways, thanks for pointing that out. I'll continue researching to find out if there's any possible way to sign DMGs on linux. If I do find anything, will let you know

Was this page helpful?
0 / 5 - 0 ratings

Related issues

talarari picture talarari  Â·  3Comments

omarkilani picture omarkilani  Â·  3Comments

philcockfield picture philcockfield  Â·  3Comments

ccorcos picture ccorcos  Â·  3Comments

noahprince22 picture noahprince22  Â·  3Comments