0

我正在尝试 Flatpak 一个 Vuejs/Electron 应用程序。在构建期间,我可以调用 Electron-Builder(但因为它是一个 Vue 应用程序,它会抱怨 not found background.js)。打包 Vuejs 的标准方式似乎是使用:

vue-cli-service electron:build

但是在 Flatpak 的构建时调用它会显示这个错误:

Electron 无法正确安装,请删除 node_modules/electron 并重新安装

是否缺少某些东西vue-cli-service以正确运行,但不包含在 中package.json

4

1 回答 1

0

解决方案是将此命令添加到build-commands

build-commands:
  # For some reason the install.js in the electron folder has to be executed
  - cd node_modules/electron && node install.js
  # After that you can run the electron:build
  - node_modules/.bin/vue-cli-service electron:build
于 2022-01-08T09:13:22.470 回答