-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
electron-builder packages with wrong electron binary version #3984
Comments
No, electron-builder checks installed version — see
Maybe you use custom project dir during build (that not equal to actual project dir, where node modules installed)? |
You are correct, I use a fresh clone (from .git) to prepare builds in a subdirectory. (to prevent using a dirty workspace by accident) After building I remove the I can confirm that the issue does not occur when the dev-dependencies are present/installed. |
Another workaround for such build scripts: pass CLI arg |
...not hooked up yet, plus electron exists in the parent repo simply to get its version number, needs sensibly enumerating instead eg: electron-userland/electron-builder#3984
If you are trying to upgrade to Electron 7.0, make sure your dev dependencies is like the following "devDependencies": {
"electron": "7.0.0",
} Notice it has to be |
If using a yarn-workspaces based mono-repo and seeing "none of the possible electron modules are installed", add the following to your
This forces |
electron-builder cannot tolerate electron versions that are specified with semantic versioning syntax: electron-userland/electron-builder#3984 (comment) This change also adds release builds to the presubmit, to prevent regressions.
I have similar issue while using npm workspaces. I have structure
Maybe the Or, why can't the version be extracted from |
The fix for me was replacing |
@develar solution is best for monorepos |
Working in a Yarn monorepo workspace this solution worked! "workspaces": {
"packages":[
"apps/*"
],
"nohoist": [
"**electron**"
]
}, Thank you @develar ! 😎 |
Normally electron-builder will look inside `node_modules` to detect the version of electron installed, but it's not likely to look for hoisted one, and falls back to search from `dependencies` entry in package.json. This change is a workaround for the following error: Cannot compute electron version from installed node modules - none of the possible electron modules are installed and version ("^25.1.1") is not fixed in project. See electron-userland/electron-builder#3984 (comment)
…tection # Configured project to prevent hoisting of Electron dependency, fixing an issue where electron-builder could not correctly identify the installed Electron version. This adjustment is crucial for accurate application packaging and notarization. # Reference: electron-userland/electron-builder#3984
electron version to 7.0.1; update electron-builder to 22.4.0 |
I have [email protected] installed but when I package, electron-builder downloads [email protected] which is not the version I developed and tested with. This may lead to very unfortunate bugs/incompatibilities.
Details:
electron-builder
appears to rely on the electron version provided inpackage.json
and ignores installed/locked versions.A version string like
^5.0.0
can be understood as5.0.0 >= allowed versions > 6.0.0
.Example
While version 5 is specified in
package.json
The package manager may/will choose to install more recent packages:
yarn.lock
yarn.lock
orpackage-lock.json
do reflect the actual used package versions.The workaround is to set the specific electron version in the
package.json
dependencies, this is however not the way one normally uses the package manager since lock files exist. (and will most certainly interfere with greenkeeper and depandabot)Just noticed this by accident, packaging using electron
5.0.0
and expecting5.0.4
(since I specifically updated to5.0.4
) would have caused a lot of headaches.The text was updated successfully, but these errors were encountered: