Official documentation: https://simulatedgreg.gitbooks.io/electron-vue/content/cn/
Project: https://github.com/SimulatedGREG/electron-vue
Step1. Install node.js and yarn
npm install -g yarn
Step2. Install a local dependency module
npm install -g node-gyp
npm install --global --production windows-build-tools (need admin permissions, cmd command needs to run as admin. At the same time installation time longer.)
One way PS.admin privileges to run cmd: Search for cmd, right, run as administrator
Two appeared successful, it represents a dependency has been successfully installed.
Step3. Ready to run
# Install vue-cli and scaffold boilerplate npm install -g vue-cli vue init simulatedgreg/electron-vue my-project # Install dependencies and run your app cd my-project yarn # or npm install yarn run dev # or npm run dev
The first two sentences executed, after the completion of the installation environment, the implementation in the root directory of the project: yarn, it will begin the installation dependent on need.
Halfway encountered error:
Because part of the file chromedriver is to wall off the domestic network, you can not download the complete package chromedirver,
Solution: npm install chromedriver --chromedriver_cdnurl = HTTP: //cdn.npm.taobao.org/dist/chromedriver
Development environment running the command: yarn run dev
The following screen instructions to run after a successful run:
. PS Other error encountered:
1. Electron failed to install correctly, please delete node_modules/electron and try installing again
Treatment: After deleting node_modules / electron, execute the command: npm install --save-dev electron reinstall the electron
2.Error: listen EADDRINUSE: address already in use :::9080
Treatment: Under ①cmd, execute netstat -ano view all active connections, find the corresponding port number is occupied PID
② execute the command: tasklist | findstr PID , you can see which process is using the port
③ the need arises, the end of the occupation of the port of manual procedures, or use the taskkill command in cmd, syntax is as follows