Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Builds failing after upgrading to electron-builder 24.x #7494

Closed
kylekirkby opened this issue Mar 23, 2023 · 13 comments · Fixed by #7511 or #7509
Closed

Builds failing after upgrading to electron-builder 24.x #7494

kylekirkby opened this issue Mar 23, 2023 · 13 comments · Fixed by #7511 or #7509

Comments

@kylekirkby
Copy link

kylekirkby commented Mar 23, 2023

  • Electron-Builder Version: 24.1.0
  • Node Version: v18.14.2
  • Electron Version: 23.2.0
  • Target: Mac OSX / Windows / Linux

After upgrading to electron-builder 24.1.0, our builds have started failing with:

OSX/node_modules/app-builder-lib/src/electron/electronVersion.ts:102
error	23-Mar-2023 07:49:46	    throw new InvalidConfigurationError(
error	23-Mar-2023 07:49:46	          ^
error	23-Mar-2023 07:49:46	InvalidConfigurationError: Cannot compute electron version from installed node modules - none of the possible electron modules are installed.
error	23-Mar-2023 07:49:46	See https://github.com/electron-userland/electron-builder/issues/3984#issuecomment-504968246

I've tried every suggestion mentioned on #3984 (comment) but have had no success.

Any idea what's happening here?

@mmaietta
Copy link
Collaborator

Oomph, I can take a look at this asap. Surprised it wasn't caught in any of the alpha versions.

Would you be willing to put together a minimum reproducible repo for this? That'd help immensely

@glennmartinez
Copy link

glennmartinez commented Mar 26, 2023

Getting the same here, latest electron with latest electron-builder.
Build 23.6.0 is the latest that works for me atm.

@mmaietta
Copy link
Collaborator

mmaietta commented Mar 26, 2023

I need more info to work with here. Please post build logs with env var DEBUG=electron-builder or a minimum reproducible repo/gist (such as with electron-quick-start). Please also post your electron-builder config if possible

Are your projects using native modules?

@zibra
Copy link

zibra commented Mar 28, 2023

same on my end, but I don't think it's related to electron-builder.
I was always using "electron-builder": "24.0.0" and all was o till today when I run npm install. No changes in the package.json / package-lock.json.
I have second project and I've reproduced same problem:

  • run npm run package - all was fine
  • npm install
  • npm run package fails with Cannot compute electron version from installed node modules

Downgrading to 23.6.0 works for me. All above fails

@1zilc
Copy link

1zilc commented Mar 28, 2023

same problem

@glennmartinez
Copy link

@mmaietta I'm using this project https://github.com/electron-react-boilerplate/electron-react-boilerplate and to reproduce just try to bump electron-builder dependency. I don't have any probs with the latest 23.alpha versions, only from 24 onwards.

@mmaietta
Copy link
Collaborator

mmaietta commented Mar 28, 2023

Hmmm does this repro for you guys on m1 devices? Or is it only on intel-based macs?
Are your npm modules already installed when running npm electron-builder or are you requiring electron-builder to do so?

@glennmartinez I just tried that project: Set electron-builder 24.1.1 and upped electron to 23.2.0 (also tried with 23.0.0), then ran npm install && npm run package successfully.

For those that are experiencing this failing build, can someone please post a build log with DEBUG=electron-builder env var?

@1zilc
Copy link

1zilc commented Mar 29, 2023

Hmmm does this repro for you guys on m1 devices? Or is it only on intel-based macs? Are your npm modules already installed when running npm electron-builder or are you requiring electron-builder to do so?

@glennmartinez I just tried that project: Set electron-builder 24.1.1 and upped electron to 23.2.0 (also tried with 23.0.0), then ran npm install && npm run package successfully.

For those that are experiencing this failing build, can someone please post a build log with DEBUG=electron-builder env var?

This is the build log for my project https://github.com/1zilc/fishing-funds/actions/runs/4549186129/jobs/8020996987 . I have added the DEBUG=electron-builder environment variable. My project is based on the electron-react-boilerplate, It seems to be related to the packaging scheme of this project. I think we should submit an issue to ERB 🤔️

@ajgassner
Copy link

ajgassner commented Mar 29, 2023

I have the same issue.

A possible workaround is to define electron under devDependencies in the app/package.json. I found no way to define electronVersion via config, env var etc....

My project doesn't depend on electron-react-boilerplate. It's a simple project with a native dependecy (node-printer) , a main dev package.json and a app/package.json

export async function getElectronVersion(
fails to get the electron version. Parameter projectDir is set to /Users/xxx/dev/ws/xxx/app-project-root/app

My env:
Electron-Builder Version: 24.1.1
Node Version: v18.12.1
Electron Version: 23.2.0
Target: Mac M1 / Windows

@mmaietta
Copy link
Collaborator

Thanks all for the logs and project info! I was able to identify the issue and have implemented a fix. Also added a fixture+test to cover the two-package.json project structure with a native module. Tested the fix using the fixture and a fork of @1zilc's project

Please try 24.1.2
My apologies for any frustrations/issues this caused.

@1zilc
Copy link

1zilc commented Mar 30, 2023

Thanks all for the logs and project info! I was able to identify the issue and have implemented a fix. Also added a fixture+test to cover the two-package.json project structure with a native module. Tested the fix using the fixture and a fork of @1zilc's project

Please try 24.1.2 My apologies for any frustrations/issues this caused.

Very thanks for your work! 24.1.2 solved this issue

@glennmartinez
Copy link

@mmaietta nice one buddy!!!

@douglassllc
Copy link

My issues was that I had rolled back my node version to v16.x to work on another project. This was what was causing my issues. Once I changed my working node version v18.x, everything worked.

Hope this helps others.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
7 participants