action-electron-builder icon indicating copy to clipboard operation
action-electron-builder copied to clipboard

Electron Builder Script not working

Open kavinvalli opened this issue 3 years ago • 8 comments

Hi. I am getting this error in the workflow

Building and releasing the Electron app…
not found: electron-builder
/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:144
				throw err;
				^

Error: Command failed: npx --no-install electron-builder --linux --publish always 
    at checkExecSyncError (child_process.js:621:11)
    at execSync (child_process.js:657:15)
    at run (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:21:27)
    at runAction (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:132:4)
    at Object.<anonymous> (/home/runner/work/_actions/samuelmeuli/action-electron-builder/v1/index.js:150: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)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10) {
  status: 127,
  signal: null,
  output: [ null, null, null ],
  pid: 2511,
  stdout: null,
  stderr: null
}

Should I add it in my dependencies?

kavinvalli avatar Dec 19 '20 05:12 kavinvalli

same error, anyone advice?

pigLoveRabbit520 avatar Jan 18 '21 03:01 pigLoveRabbit520

Same for me 😞

mkurczewski avatar Feb 01 '21 16:02 mkurczewski

Same for me too

boyphongsakorn avatar Feb 01 '21 21:02 boyphongsakorn

i add

- run: npm install electron-builder --save-dev

in build.yml it's work but error from postInstall -_-

boyphongsakorn avatar Feb 01 '21 21:02 boyphongsakorn

I fixed it by moving the electron dependency to devDeps (I still think that it is not this library to decide where the dep. should be..) And adding an extra env option:

env:
  NODE_OPTIONS: '--max_old_space_size=4096'

ThomasReyskens avatar Feb 10 '21 16:02 ThomasReyskens

I fixed it by moving the electron dependency to devDeps (I still think that it is not this library to decide where the dep. should be..) And adding an extra env option:

env:
  NODE_OPTIONS: '--max_old_space_size=4096'

I did not understand very well, I have the same problem but I do not have much knowledge of Actions. 😢

kaiserdj avatar Feb 10 '21 17:02 kaiserdj

i add

- run: npm install electron-builder --save-dev

in build.yml it's work but error from postInstall -_-

Having the same error, but this did not solve the problem. Did anybody find another approach?

ransome1 avatar Mar 16 '21 13:03 ransome1

You could add the environment variables in the workflow yaml file. This is an example:

      - name: Build/release Electron app
        uses: samuelmeuli/action-electron-builder@v1
        with:
          # GitHub token, automatically provided to the action
          # (No need to define this secret in the repo settings)
          github_token: ${{ secrets.github_token }}

          # If the commit is tagged with a version (e.g. "v1.0.0"),
          # release the app after building
          release: ${{ startsWith(github.ref, 'refs/tags/v') }}
        env:
          NODE_OPTIONS: '--max_old_space_size=4096'

I was getting a similar error, but after checking a little closer, I was trying to build pacman packages but with the current runner, it seems that Github changed the default runner to Ubuntu 20.04 a few months ago https://github.blog/changelog/2020-10-29-github-actions-ubuntu-latest-workflows-will-use-ubuntu-20-04/

This is causing some errors related with the missing binary bsdtar used by the pacman builder. I found this workaround https://github.com/electron-userland/electron-builder/issues/4181 . Just install libarchive-tools for the runner.

Can you try this? This is a reported error https://github.com/samuelmeuli/action-electron-builder/issues/42

julian-alarcon avatar Jul 07 '21 22:07 julian-alarcon