无效的URI:无法解析主机名。电子生成器

时间:2017-07-11 11:08:45

标签: javascript node.js electron electron-builder

我无法使用松鼠建立电子应用程序。虽然iconUrl有效。 的package.json:

"squirrelWindows": {
  "iconUrl": "http://95.85.39.111:5005/skylog.ico"
},

错误:

  

未处理的异常:System.UriFormatException:无效的URI:无法解析主机名。

完整追踪:

Error: Exit code: 4294967295. Command failed: 
C:\Users\emretekince\AppData\Local\electron-
builder\cache\Squirrel.Windows\Squirrel.Windows-1.6.0.0\Update.com --
releasify C:\Users\emretekince\Desktop\DCSLogBook\client\dist\win\skylog-
0.1.0-full.nupkg --releaseDir C:
\Users\emretekince\Desktop\DCSLogBook\client\dist\win
2017-07-11 14:17:28> Unhandled exception: System.UriFormatException: Invalid 
URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
at System.Uri..ctor(String uriString)
at NuGet.ManifestMetadata.NuGet.IPackageMetadata.get_ProjectUrl()
at NuGet.LocalPackage.ReadManifest(Stream manifestStream)
at NuGet.ZipPackage.EnsureManifest()
at NuGet.ZipPackage..ctor(String filePath, Boolean enableCaching)
at Squirrel.Update.Program.ReleasifyElectron(String package, String targetDir, String baseUrl)
at Squirrel.Update.Program.executeCommandLine(String[] args)
at Squirrel.Update.Program.main(String[] args)


⚠️  Cannot delete temporary dir "C:\Users\EMRETE~1\AppData\Local\Temp\electron-builder-jyFHH6": Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\EMRETE~1\AppData\Local\Temp\electron-builder-jyFHH6'
    at Object.fs.rmdirSync (fs.js:851:18)
    at rmkidsSync (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\fs-extra\lib\remove\rimraf.js:292:11)
    at rmdirSync (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\fs-extra\lib\remove\rimraf.js:281:7)
    at rimrafSync (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\fs-extra\lib\remove\rimraf.js:252:7)
    at process.cleanup (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\electron-builder-util\src\tmp.ts:36:13)
    at emitOne (events.js:120:20)
    at process.emit (events.js:210:7)
    at process.emit (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\source-map-support\source-map-support.js:430:21)
    at process.exit (internal/process.js:154:15)
    at printErrorAndExit (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\electron-builder-util\src\promise.ts:5:11)
    at tryCatcher (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\bluebird\js\release\util.js:16:23)
    at Promise._settlePromiseFromHandler (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\bluebird\js\release\promise.js:512:31)
    at Promise._settlePromise (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\bluebird\js\release\promise.js:569:18)
    at Promise._settlePromise0 (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\bluebird\js\release\promise.js:614:10)
    at Promise._settlePromises (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\bluebird\js\release\promise.js:689:18)
    at Async._drainQueue (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\bluebird\js\release\async.js:133:16)
    at Async._drainQueues (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\bluebird\js\release\async.js:143:10)
    at Immediate.Async.drainQueues (C:\Users\emretekince\Desktop\DCSLogBook\client\node_modules\bluebird\js\release\async.js:17:14)

1 个答案:

答案 0 :(得分:0)

这是一个有效的URL,但看起来处理这些内部逻辑的内部逻辑在解析主机名时遇到问题(因为没有,你已经用IP替换了主机名)。解决方案可能是针对https://github.com/Squirrel/Squirrel.Windows

提出问题

更好的解决方案可能是从Squirrel迁移并使用电子生成器附带的NSIS安装程序。 Iirc是主要的维护者,develar,主张使用NSIS而不是Squirrel。根据我的经验,它更清洁,更易于使用。在我看来,使用Squirrel的唯一原因是如果你需要与另一个依赖松鼠的工具集成。