Package for Squirrel.Windows failed on macOS.
Build options in package.json:
...
"win": {
"icon": "asset/icon.ico",
"target": [
"squirrel"
]
},
"squirrelWindows": {
"iconUrl": "https://ecm.inspur.com/setup.ico"
},
...
Full error stack:
$ build -w
electron-builder 19.27.2
鈿狅笍 public/electron.js not found. Please see https://medium.com/@kitze/%EF%B8%8F-from-react-to-an-electron-app-ready-for-production-a0468ecb1da3
No native production dependencies
Packaging for win32 x64 using electron 1.6.11 to dist/win-unpacked
Building Squirrel.Windows for arch x64
Error: Exit code: 255. Command failed: mono /Users/yisiqi/Library/Caches/electron-builder/Squirrel.Windows/Squirrel.Windows-1.6.0.0/Update-Mono.exe --releasify /Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/dist/win/cloud-plus-0.1.0-full.nupkg --releaseDir /Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/dist/win
2017-09-01 11:21:26> Unhandled exception: System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.Parse (UriKind kind, System.String uriString) [0x00000] in <filename unknown>:0
at System.Uri.ParseUri (UriKind kind) [0x00000] in <filename unknown>:0
at System.Uri..ctor (System.String uriString, Boolean dontEscape) [0x00000] in <filename unknown>:0
at System.Uri..ctor (System.String uriString) [0x00000] in <filename unknown>:0
at NuGet.ManifestMetadata.NuGet.IPackageMetadata.get_ProjectUrl () [0x00000] in <filename unknown>:0
at NuGet.LocalPackage.ReadManifest (System.IO.Stream manifestStream) [0x00000] in <filename unknown>:0
at NuGet.ZipPackage.EnsureManifest () [0x00000] in <filename unknown>:0
at NuGet.ZipPackage..ctor (System.String filePath, Boolean enableCaching) [0x00000] in <filename unknown>:0
at NuGet.ZipPackage..ctor (System.String filePath) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.ReleasifyElectron (System.String package, System.String targetDir, System.String baseUrl) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.executeCommandLine (System.String[] args) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.main (System.String[] args) [0x00000] in <filename unknown>:0
System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.Parse (UriKind kind, System.String uriString) [0x00000] in <filename unknown>:0
at System.Uri.ParseUri (UriKind kind) [0x00000] in <filename unknown>:0
at System.Uri..ctor (System.String uriString, Boolean dontEscape) [0x00000] in <filename unknown>:0
at System.Uri..ctor (System.String uriString) [0x00000] in <filename unknown>:0
at NuGet.ManifestMetadata.NuGet.IPackageMetadata.get_ProjectUrl () [0x00000] in <filename unknown>:0
at NuGet.LocalPackage.ReadManifest (System.IO.Stream manifestStream) [0x00000] in <filename unknown>:0
at NuGet.ZipPackage.EnsureManifest () [0x00000] in <filename unknown>:0
at NuGet.ZipPackage..ctor (System.String filePath, Boolean enableCaching) [0x00000] in <filename unknown>:0
at NuGet.ZipPackage..ctor (System.String filePath) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.ReleasifyElectron (System.String package, System.String targetDir, System.String baseUrl) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.executeCommandLine (System.String[] args) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.main (System.String[] args) [0x00000] in <filename unknown>:0
2017-09-01 11:21:26> Unhandled exception: System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.Parse (UriKind kind, System.String uriString) [0x00000] in <filename unknown>:0
at System.Uri.ParseUri (UriKind kind) [0x00000] in <filename unknown>:0
at System.Uri..ctor (System.String uriString, Boolean dontEscape) [0x00000] in <filename unknown>:0
at System.Uri..ctor (System.String uriString) [0x00000] in <filename unknown>:0
at NuGet.ManifestMetadata.NuGet.IPackageMetadata.get_ProjectUrl () [0x00000] in <filename unknown>:0
at NuGet.LocalPackage.ReadManifest (System.IO.Stream manifestStream) [0x00000] in <filename unknown>:0
at NuGet.ZipPackage.EnsureManifest () [0x00000] in <filename unknown>:0
at NuGet.ZipPackage..ctor (System.String filePath, Boolean enableCaching) [0x00000] in <filename unknown>:0
at NuGet.ZipPackage..ctor (System.String filePath) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.ReleasifyElectron (System.String package, System.String targetDir, System.String baseUrl) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.executeCommandLine (System.String[] args) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.main (System.String[] args) [0x00000] in <filename unknown>:0
System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.Parse (UriKind kind, System.String uriString) [0x00000] in <filename unknown>:0
at System.Uri.ParseUri (UriKind kind) [0x00000] in <filename unknown>:0
at System.Uri..ctor (System.String uriString, Boolean dontEscape) [0x00000] in <filename unknown>:0
at System.Uri..ctor (System.String uriString) [0x00000] in <filename unknown>:0
at NuGet.ManifestMetadata.NuGet.IPackageMetadata.get_ProjectUrl () [0x00000] in <filename unknown>:0
at NuGet.LocalPackage.ReadManifest (System.IO.Stream manifestStream) [0x00000] in <filename unknown>:0
at NuGet.ZipPackage.EnsureManifest () [0x00000] in <filename unknown>:0
at NuGet.ZipPackage..ctor (System.String filePath, Boolean enableCaching) [0x00000] in <filename unknown>:0
at NuGet.ZipPackage..ctor (System.String filePath) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.ReleasifyElectron (System.String package, System.String targetDir, System.String baseUrl) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.executeCommandLine (System.String[] args) [0x00000] in <filename unknown>:0
at Squirrel.Update.Program.main (System.String[] args) [0x00000] in <filename unknown>:0
at /Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/builder-util/src/util.ts:86:16
at ChildProcess.exithandler (child_process.js:211:5)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:886:16)
at Socket.<anonymous> (internal/child_process.js:342:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)
From previous event:
at exec (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/builder-util/src/util.ts:58:3)
at /Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder-squirrel-windows/src/squirrelPack.ts:183:16
at next (native)
From previous event:
at releasify (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder-squirrel-windows/out/squirrelPack.js:157:22)
at /Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder-squirrel-windows/src/squirrelPack.ts:90:30
From previous event:
at buildInstaller (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder-squirrel-windows/out/squirrelPack.js:61:21)
at /Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder-squirrel-windows/src/squirrelWindows.ts:41:11
at next (native)
From previous event:
at SquirrelWindowsTarget.build (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder-squirrel-windows/out/squirrelWindows.js:85:11)
at taskManager.addTask.default.map.it (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/src/platformPackager.ts:110:85)
From previous event:
at WinPackager.packageInDistributableFormat (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/src/platformPackager.ts:110:41)
at /Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/src/platformPackager.ts:106:10
From previous event:
at WinPackager.pack (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/out/platformPackager.js:174:11)
at /Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/src/packager.ts:259:24
From previous event:
at Packager.doBuild (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/out/packager.js:338:11)
at /Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/src/packager.ts:185:52
at next (native)
From previous event:
at Packager.build (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/out/packager.js:257:11)
at /Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/src/builder.ts:266:40
at next (native)
From previous event:
at build (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/out/builder.js:69:21)
at loadEnv.then (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/src/cli/cli.ts:49:4)
at runCallback (timers.js:666:20)
at tryOnImmediate (timers.js:639:5)
at processImmediate [as _immediateCallback] (timers.js:611:5)
From previous event:
at Object.args [as handler] (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/src/cli/cli.ts:49:4)
at Object.self.runCommand (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/yargs/lib/command.js:233:22)
at Object.Yargs.self._parseArgs (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/yargs/yargs.js:1018:24)
at Object.get [as argv] (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/yargs/yargs.js:927:19)
at Object.<anonymous> (/Users/yisiqi/Developer/Workspaces/GitLab@Inspur/ecc/client-desktop/node_modules/electron-builder/src/cli/cli.ts:43:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:393:7)
at startup (bootstrap_node.js:150:9)
at bootstrap_node.js:508:3
error Command failed with exit code 255.
I just resolved this.
By tracking Squirrel and NuGet codes, I found it will verify projectUrl. And this property should have a valid URL value. Follow the configuration guide of electron-builder, this property is the homepage property in package.json.
Finally, I changed the homepage property to the product's homepage URL and rebuild my project. No more errors bother me.
Hope this will be helpful.
Thanks so much for this! 馃檶
Most helpful comment
I just resolved this.
By tracking Squirrel and NuGet codes, I found it will verify
projectUrl. And this property should have a valid URL value. Follow the configuration guide of electron-builder, this property is thehomepageproperty in package.json.Finally, I changed the
homepageproperty to the product's homepage URL and rebuild my project. No more errors bother me.Hope this will be helpful.