electron 电子构建失败

ccrfmcuu  于 2023-05-11  发布在  Electron
关注(0)|答案(2)|浏览(218)

电子构建失败。
错误:找不到模块“favicon. ico”需要堆栈:

  • /Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/builder-util/out/fs.js
  • /Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/builder-util/out/util.js
  • /Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/electron-builder/out/cli/cli.js
  • /Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/electron-builder/cli.js at Function.Module._resolveFilename(internal/modules/cjs/loader.js:797:15)at Function.Module._load(internal/modules/cjs/loader.js:690:27)at Module.require(internal/modules/cjs/loader.js:852:19)at require(internal/modules/cjs/helpers.js:74:18)at Object.(/Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/builder-util/src/fs.ts:4:(1)模块。_compile(internal/modules/cjs/loader.js:九五九:30)在Object.Module._extensions..js(internal/modules/cjs/loader. js:九九五:10)在模块上。load(internal/modules/cjs/loader.js:八一五:32)在Function.Module._load(internal/modules/cjs/loader. js:七二七:14)在模块。require(internal/modules/cjs/loader. js:八五二:19)at require(internal/modules/cjs/helpers.js:七十四:(18)对象。(/Users/abhimatta/Documents/abhishek/accura-electron-dev/node_modules/builder-util/src/util.ts:24:1)at Module._compile(internal/modules/cjs/loader.js:959:30)at Object.Module._extensions..js(internal/modules/cjs/loader.js:995:10)at Module.load(internal/modules/cjs/loader.js:815:32)at Function.Module._load(internal/modules/cjs/loader.js:727:14)
    Package.json配置
"electron": "^10.4.0",
"electron-builder": "^22.10.4",
bvn4nwqk

bvn4nwqk1#

我正在学习电子学。零级。
1.我会检查你的节点和电子版本是否匹配。Info:https://www.electronjs.org/docs/latest/tutorial/electron-timelines我的版本-- node 12.22.7 -- electron 11.5.0
1.我在学习Electron时消除了这个错误:如果出现错误:“cannot find module'fs/promises' then npm uninstall electron-builder and npm i electron-builder@22.10.5
开发人员声称,这个错误确实存在于节点12中,并在节点14+中得到修复。

jslywgbw

jslywgbw2#

转到node_modules文件夹。找到电子更新器。转到out和AppUpdater.js,然后更改

const promises_1 = require("fs/promises");

const promises_1 = require("fs").promises;

相关问题