npm install fails with "Cannot compute electron version"
ryantrem opened this issue · comments
Ryan Tremblay commented
Describe the bug
I ran npm create @quick-start/electron electron-test -- --template react-ts
, and then from the electron-test
directory ran npm install
, and got the following error:
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c electron-builder install-app-deps
npm ERR! • electron-builder version=23.6.0
npm ERR! • loaded configuration file=C:\Users\ryant\Repos\MetaVision\apps\electron\electron-builder.yml
npm ERR! ⨯ Cannot compute electron version from installed node modules - none of the possible electron modules are installed and version ("^21.3.3") is not fixed in project.
npm ERR! See https://github.com/electron-userland/electron-builder/issues/3984#issuecomment-504968246
If I open package.json
and change "electron": "^21.3.3"
to "electron": "21.3.3"
, then npm install
succeeds and I can run the app.
Used Scaffolding
create-electron
Used Package Manager
npm
Validations
- Follow the Code of Conduct.
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
alex.wei commented
Have you ever installed Electron globally. This looks like an environmental issue but not create-electron
.
you can remove script: postinstall: electron-builder install-app-deps
Ryan Tremblay commented
I've not installed it globally, but I am using create-electron
within an npm workspace that has another electron app that was created manually.