SimulatedGREG / electron-vue

An Electron & Vue.js quick start boilerplate with vue-cli scaffolding, common Vue plugins, electron-packager/electron-builder, unit/e2e testing, vue-devtools, and webpack.
https://simulatedgreg.gitbooks.io/electron-vue/content/
MIT License
15.47k stars 1.54k forks source link

electron7 please! #975

Open halohsu opened 4 years ago

halohsu commented 4 years ago

Please support electron 7, thx

zaherg commented 4 years ago

What is the problem you are facing with v7? I have my application running on v7 with no problems

zaherg commented 4 years ago

@bluemiaomiao check this issue https://github.com/SimulatedGREG/electron-vue/issues/855 also this comment if you are using node >11 https://github.com/SimulatedGREG/electron-vue/issues/871#issuecomment-490370237

halohsu commented 4 years ago

I try to use the new version of electron to complete the automatic dark mode under macOS Catalina. I have the following problems:

yarn run v1.21.1
warning package.json: License should be a valid SPDX license expression
$ node .electron-vue/dev-runner.js
/Users/key/Source/WebStormProjects/my-project/node_modules/electron/index.js:14
    throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
    ^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
    at getElectronPath (/Users/key/Source/WebStormProjects/my-project/node_modules/electron/index.js:14:11)
    at Object.<anonymous> (/Users/key/Source/WebStormProjects/my-project/node_modules/electron/index.js:18:18)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/Users/key/Source/WebStormProjects/my-project/.electron-vue/dev-runner.js:4:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

My development environment is:

System: macOS Catalina, 10.15.3
Nodejs Version: v10.18.1
Electron: 7.1.0
Code Editor: VS Code Stable

And I also encountered this problem in version 8.0.0! Although this problem was finally solved by me, I hope to provide a selection list that can provide an electron version when executing the project creation command!!! The mission of electron-vue is to simplify our work :)

zaherg commented 4 years ago

Are you sure you have made all the requirements for your code? I am asking you because I have my application (not released it yet) running on Electron 8 and the current version (on my site) is running on Electron 7.

Screen_Shot_2020-02-11_at_11_30_06_AM

And both working fine with the automatic dark mode functionality.

System: macOS Catalina, 10.15.3
Nodejs Version: v13.5.0
Electron: 8.0.0
halohsu commented 4 years ago

I think it's necessary for me to provide you with the steps to create my project.

vue init simulatedgreg/electron-vue demo
cd demo
yarn
yarn upgrade electron@8.0.0
yarn run dev

Then something went wrong with the project. I can't find the steps to change the electron version...

zaherg commented 4 years ago

This won't work with you as I told you before, you need to follow the steps in the issue https://github.com/SimulatedGREG/electron-vue/issues/855 and this, in particular, is what I've done https://github.com/SimulatedGREG/electron-vue/issues/855#issuecomment-503002257

halohsu commented 4 years ago

Can a version selection function be provided? As follows:

Which version of electron do you want to use?
-> Electron 2.0.0
-> Electron 6.0.0
-> Electron 8.0.0
-> Electron 7.0.0

I think it's a good suggestion!

Zhwt commented 4 years ago

@bluemiaomiao In case you can use npm command, you can try the following:

  1. Delete node_modules/electron/ folder or rename it.
  2. Change electron's version number in package.json according to your spec (not necessary if you provided the version number in step 3).
  3. Run npm i electron in your project directory.

Not tested on 8.0.0 but I'm currently using 7.1.11 and these steps works for me :)