Electron-builder: Build fails with "Error: `background` missing from JSON Specification"

Created on 11 May 2016  ยท  8Comments  ยท  Source: electron-userland/electron-builder

This only recently started happening as we wiped our npm cache and it updated to the latest patch release. The docs suggest that this attribute is optional.

Error: `background` missing from JSON Specification
    at Object.fn (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/appdmg.js:152:12)
    at Pipeline._runStep (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/pipeline.js:44:8)
    at Pipeline._run (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/pipeline.js:93:8)
    at Function.next.skip (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/pipeline.js:39:21)
    at Object.fn (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/appdmg.js:111:37)
    at Pipeline._runStep (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/pipeline.js:44:8)
    at Pipeline._run (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/pipeline.js:93:8)
    at Function.next.skip (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/pipeline.js:39:21)
    at Object.fn (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/appdmg.js:94:37)
    at Pipeline._runStep (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/pipeline.js:44:8)
    at Pipeline._run (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/pipeline.js:93:8)
    at next (/Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/pipeline.js:33:23)
    at /Users/distiller/propeller-desktop/node_modules/appdmg-tf/lib/appdmg.js:84:9
    at FSReqWrap.cb [as oncomplete] (fs.js:251:19)
From previous event:
    at OsXPackager.packageInDistributableFormat (/Users/distiller/propeller-desktop/node_modules/electron-builder/src/osxPackager.ts:183:20)
    at nonMasPromise.doPack.then.then (/Users/distiller/propeller-desktop/node_modules/electron-builder/src/osxPackager.ts:58:74)
From previous event:
    at OsXPackager.<anonymous> (/Users/distiller/propeller-desktop/node_modules/electron-builder/src/osxPackager.ts:58:10)
    at undefined.next (native)
From previous event:
    at tsAwaiter (/Users/distiller/propeller-desktop/node_modules/electron-builder/src/awaiter.ts:10:47)
    at Object.build (/Users/distiller/propeller-desktop/node_modules/electron-builder/src/builder.ts:30:59)
    at Object.<anonymous> (/Users/distiller/propeller-desktop/node_modules/electron-builder/src/build-cli.ts:47:2)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:456:32)
    at tryModuleLoad (module.js:415:12)
    at Function.Module._load (module.js:407:3)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:445:3
feature mac

Most helpful comment

background is no longer a mandatory option in appdmg version 0.4.2 ๐Ÿ‘

All 8 comments

Do you have file build/background.png?

According to Options it's optional: it already has a default of build/background.png.

The path to background (default: build/background.png). The resolution of this file determines the resolution of the installer window.

@mitchhentges Do you have file build/background.png in your project?

I don't (yet), but I'm just trying to get electron-builder set up for the first time. I _can_ create a dummy png, but while I'm "just testing" electron-builder with my app, I'm trying to do the minimum configuration required.

I too was fooled by the documentation, thinking that I could get a build without specifying a background. No problem though, I'll set one up. It's just a little contradictive.

@mitchhentges It is going to be fixed soon https://github.com/LinusU/node-appdmg/issues/95 For now please add some image.

background is no longer a mandatory option in appdmg version 0.4.2 ๐Ÿ‘

Test enabled and functionality uncommented on our side โ€” works perfectly, @LinusU thanks a lot! Less required steps before build app โ€” more user-friendly.

Thanks all ๐Ÿ˜„

Was this page helpful?
0 / 5 - 0 ratings