【发布时间】:2022-01-08 00:24:01
【问题描述】:
我无法将 electron-updater 集成到我的项目中。我正在使用 Windows 系统。
首先我安装了电子更新器(通过 npm 或 yarn),它可以正常工作。
然后我通过
import { autoUpdater } from 'electron-updater' 或 const {autoUpdater} = require('electron-updater')
一旦我构建并运行应用程序,我会得到一个 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)
尝试了不同版本的 electron-updater、electron-builder、node 和 npm,尝试通过 yarn 构建,有或没有分布设置(通用) => 都导致基本相同的问题。
我的项目使用SimulatedGREG/electron-vue。 可以通过设置默认样板、安装 electron-updater 并取消注释准备好的 autoLoad 代码来重现问题。
有什么想法吗?我基本上被困了一天,找不到前进的路。
【问题讨论】:
标签: javascript electron electron-builder electron-vue electron-updater