alex8088 / quick-start

An easy way to start a front-end project.
MIT License
265 stars 37 forks source link

npm install fails with "Cannot compute electron version" #10

Closed ryantrem closed 1 year ago

ryantrem commented 1 year ago

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

alex8088 commented 1 year ago

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

ryantrem commented 1 year ago

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.