我在集成电子更新器到我的项目中遇到了麻烦。我在做windows系统的工作。
首先,我安装了电子更新程序(通过npm或纱线),它的工作没有问题。
然后,我通过import { autoUpdater } from 'electron-updater'或const {autoUpdater} = require('electron-updater')加载包
一旦我构建并运行了这个应用程序,我就得到了一个带有以下TypeError的App threw an error during load:
TypeError: Cannot read property 'name' of undefined
at exports.fromCallback (E:\smaek-mm\node_modules\universalify\index.js:15:26)
at Object.<anonymous> (E:\smaek-mm\node_modules\electron-updater\node_modules\fs-extra\lib\fs\index.js:57:27)
at Object.<anonymous> (E:\smaek-mm\node_modules\electron-updater\node_modules\fs-extra\lib\fs\index.js:121:3)
at Module._compile (module.js:642:30)
at Object.Module._extensions..js (module.js:653:10)
at Module.load (module.js:561:32)
at tryModuleLoad (module.js:504:12)
at Function.Module._load (module.js:496:3)
at Module.require (module.js:586:17)
at require (internal/module.js:11:18)尝试了不同版本的电子更新器、电子生成器、节点和npm,尝试通过yarn构建,使用或不使用分布设置(通用) =>都会导致基本相同的问题。
我的项目使用SimulatedGREG/electron-vue。可以通过设置默认样板、安装电子更新器和取消注释准备好的autoLoad代码来重新创建该问题。
有什么想法吗?我基本上被困了一天,找不到前进的方向。
发布于 2021-12-02 07:44:48
看起来SimulatedGREG/electron-vue使用了一个非常过时的电子版本:
"electron": "^2.0.4"实际上,这确实适用于最新的电子生成器:
"electron-builder": "^22.14.5"但它不适用于最新的电子更新器:
"electron-updater": "^4.6.5"将电子邮件升级到最新版本解决了此问题:
"electron": "^16.0.3" 有关升级电子产品的更多信息可在此处找到:SimulatedGREG/electron-vue #871
https://stackoverflow.com/questions/70183732
复制相似问题