Path must be a string received undefined?
cyclomaticsegal opened this issue · comments
Any ideas why this grunt task fails with "Path must be a string? Also tried making the property names strings in the json literal.
var createDMG = require('electron-installer-dmg');
var opts = {
appPath: "casehub-darwin-x64",
name: "casehub",
background: 'app/images/osxDmgBackground.png',
icon: 'app/images/osxIcon.icns',
overwrite:true
};
createDMG(opts, function done(err) {
console.log("DIRTY BIG OSX DMG BUILD ERROR**********************", err);
});
@cyclomaticsegal hrrmmm... mind posting the full stacktrace you're seeing? Off-hand, know where this could happen in the code, but w/o the stack, cant immediately provide feedback as to where we need to be providing better validation/error messages.
I'm seeing the same issue, any help would be appreciated :)
➜ ~/work/gotdone-desktop-app (master) electron-installer-dmg ./release/darwin-x64/GotDone-darwin-x64/GotDone.app/ GotDone --debug
path.js:8
throw new TypeError('Path must be a string. Received ' +
^
TypeError: Path must be a string. Received undefined
at assertPath (path.js:8:11)
at Object.posix.join (path.js:479:5)
at module.exports (/Users/timmstokke/.nvm/versions/node/v4.2.1/lib/node_modules/electron-installer-dmg/index.js:67:52)
at Object.<anonymous> (/Users/timmstokke/.nvm/versions/node/v4.2.1/lib/node_modules/electron-installer-dmg/bin/electron-installer-dmg.js:29:1)
at Module._compile (module.js:435:26)
at Object.Module._extensions..js (module.js:442:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Function.Module.runMain (module.js:467:10)
at startup (node.js:134:18)
I was getting this error before setting --out
param.
The error is raised due to opts.out being undefined in https://github.com/mongodb-js/electron-installer-dmg/blob/master/index.js#L67
Had same problem, fixed by adding --out
param.
I'm getting error even after setting --out param
triconmac$ electron-installer-dmg ./app-darwin-X64/app.app/ app --out=output/installers/ { [Error: Error running
hdiutil`! Exit code was 1]
exitCode: 1,
stdout: 'Preparing imaging engine…\nReading Protective Master Boot Record (MBR : 0)…\n',
stderr: '\nhdiutil: convert failed - Invalid argument\n' }``
I tried through electron builder too, its not creating osx installer. Guys please help me
Using as an NPM script is also throwing this error unless the --out path is specified.
confirmed, adding --out= fixes the issue
Fixed by #5.