Why does vue-cli-service not find electron-builder while building the Flatpak?

338 views Asked by At

I am trying to Flatpak a Vuejs/Electron application. During build-time I can call Electron-Builder (but because it is a Vue application it complains about not finding background.js). The standard way of packaging Vuejs seems to be to use:

vue-cli-service electron:build

But calling that during build-time of the Flatpak shows this error:

Electron failed to install correctly, please delete node_modules/electron and try installing again

Is there something that is missing for vue-cli-service to run correctly, that is not included in package.json?

1

There are 1 answers

0
tobias47n9e On

The solution was to add this command to the 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