你用的是电子吗自动更新程序 https://electronjs.org/docs/api/auto-updater模块?从 API文档 https://electronjs.org/docs/api/auto-updater#autoupdatersetfeedurloptions,我看得出他们不支持。
另一方面,如果您正在使用电子更新器 https://www.npmjs.com/package/electron-updater模块,请确保您遵循推荐的发布工作流程 https://www.electron.build/configuration/publish#recommended-github-releases-workflow,并且您不应该使用 setFeedURL 检查注释here https://www.electron.build/auto-update#quick-setup-guide
Updated:
如果您正在使用电子更新器 https://www.npmjs.com/package/electron-updater并且您要发布到私有存储库,您需要确保您的令牌在app-update.yml
文件,这就是为什么很多人说不建议这样做,如果您的文件中没有设置令牌app-update.yml
文件你会得到404。
For 电子更新器 https://www.npmjs.com/package/electron-updater自动将您的令牌添加到app-update.yml
文件令牌应在发布部分中设置,如下所示:
"publish": [
{
"provider": "github",
"private": true,
"owner": "<github_owner>",
"repo": "<repo_name>",
"token": "<your github token>"
}
],
这将产生一个app-update.yml
文件如下:
owner: <github_owner>
repo: <repo_name>
provider: github
private: true
token: <your github token>
updaterCacheDirName: electron-updater-private-updater
检查这个小视频 https://i.stack.imgur.com/j6ZT3.jpg
这是我的代码https://github.com/linuxjuggler/electron-auto-update-example https://github.com/linuxjuggler/electron-auto-update-example检查electron-builder.json
file.
Update 2
根据注释中提到的快速设置指南 https://www.electron.build/auto-update#quick-setup-guide部分,你永远不应该打电话设置FeedURL.