Electron-builder: Cannot compute electron version from installed node modules - none of the possible electron modules are installed.

Created on 14 Aug 2019  Â·  13Comments  Â·  Source: electron-userland/electron-builder


  • Version:

  • Target:


backlog

Most helpful comment

I had the same problem with electron builder versions 21.x
I reverted back to builder version 20.28.4 to temporarily resolver the issue.
Not working:

npx electron-builder build --linux
npx: installed 179 in 10.314s
  • electron-builder  version=21.2.0 os=4.18.0-25-generic
  • loaded configuration  file=package.json ("build" field)
  ⨯ Cannot compute electron version from installed node modules - none of the possible electron modules are installed.

Working:

npx [email protected] build --linux
npx: installed 194 in 11.601s
  • electron-builder version=20.28.4
  • loaded configuration file=package.json ("build" field)
  • writing effective config file=<path_to_dist_builder_packages>/builder-effective-config.yaml
  • skipped app dependencies rebuild reason=npmRebuild is set to false

All 13 comments

@eugeneblog your report seems to be missing some information

Hi, we are facing an issue with the same error message. I have electron and electron builder installed locally, and somehow this is happening. I can specify the version of Electron to make it work but it should not be necessary ... Additionally, I get an error message when it does run that is impossible to read on my terminal as it has a lot of newlines which are breaking the text.

image

image

I had the same problem with electron builder versions 21.x
I reverted back to builder version 20.28.4 to temporarily resolver the issue.
Not working:

npx electron-builder build --linux
npx: installed 179 in 10.314s
  • electron-builder  version=21.2.0 os=4.18.0-25-generic
  • loaded configuration  file=package.json ("build" field)
  ⨯ Cannot compute electron version from installed node modules - none of the possible electron modules are installed.

Working:

npx [email protected] build --linux
npx: installed 194 in 11.601s
  • electron-builder version=20.28.4
  • loaded configuration file=package.json ("build" field)
  • writing effective config file=<path_to_dist_builder_packages>/builder-effective-config.yaml
  • skipped app dependencies rebuild reason=npmRebuild is set to false

I can confirm that reverting also immediately solves the issue for us too :)

any updates on this one ?

The referred issue #3984 is not a solution. I'm getting

  • electron-builder  version=21.2.0 os=5.0.0-27-generic
  • loaded configuration  file=package.json ("build" field)
  ⨯ Cannot compute electron version from installed node modules - none of the possible electron modules are installed and version ("^6.0.7") is not fixed in project.
See https://github.com/electron-userland/electron-builder/issues/3984#issuecomment-504968246

and my yarn.lock does have

electron@^6.0.7:
  version "6.0.8"

I'm building the app on a subfolder with:

electron-builder --project ./dist/apps/electron

There's my yarn.lock and my package.json with

  "files": [
    "**/*",
    "build/icon.*",
    "build/icons"
  ],
  "dependencies": {
    "@sendgrid/mail": "^6.4.0",
    "draggabilly": "2.2.0",
    "node-fetch": "^2.6.0",
    "plivo": "^4.1.3",
    "source-map-support": "^0.5.12",
    "stripe": "~7.8.0",
    "tslib": "^1.9.0"
  },
  "devDependencies": {
    "electron": "^6.0.7"
  }

The parser just accepts 6.0.8 and not ^6.0.7

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

I can confirm we still have the issue and rolling back or passing the electron version to electron-builder directly fixes the problem for the time being :)

Still applies
Switched back to version 20 works for me

It seems that electron builder has an error while trying to read the semver version of electron in 21

I had the same issue and i solved it in this way:

  1. run electron -v in the terminal

--> v7.1.8 (example)

  1. go to package.json and under "devDependencies" insert "electron": "<your version>" e.g. "electron": "7.1.8"

As @AndreaMaffe pointed out. It is required to have electron in devDependencies in the package.json file in the directory one tries to build.

Yes, the workaround for the time being is using the electron version precisely

in the package.json changing from "electron": "^8.1.0", to "electron": "8.1.0" will fix the issue.

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Was this page helpful?
0 / 5 - 0 ratings