Electron installation

Time:2020-10-14

Electron installation

Electron uses pure JavaScript to call rich native APIs to create desktop applications.

Initializing an electronic application is very simple. First, make sure that node is installed in the computer, and the node version is above 10.

A basic directory of electronic applications

your-app/
├── package.json
├── main.js
└── index.html

stay package.json It’s set inside

{
  "name": "your-app",
  "version": "0.1.0",
  "main": "main.js",
  "scripts": {
    "start": "electron ."
  }
}

To download the electron package here, you can download it from the project directory or download it globally.

npm install --save-dev electron

In this step of installation, errors are easy to occur. For example, the electronic package has been failing to download

In the MAC environment, open the~/.npmrcThis file, modify the following configuration:

registry= https://registry.npm.taobao.org
electron_mirror="https://npm.taobao.org/mirrors/electron/"

Then execute the install command to install successfully.

Recommended Today

Flutter learning notes (39) — there are more than 3 items at the bottom of the bottom NavigationBar. Only icon is displayed and title is not displayed

If you want to reprint, please indicate the source:Flutter learning notes (39) — there are more than 3 items at the bottom of the bottom NavigationBar. Only icon is displayed and title is not displayed items: [ _bottomItem(Ids.home, ‘ic_home_normal’, ‘ic_home_selected’, 0), _bottomItem(Ids.information, ‘ic_discovery_normal’, ‘ic_discovery_selected’, 1), _bottomItem(Ids.news, ‘ic_hot_normal’, ‘ic_hot_selected’, 2), _bottomItem(Ids.mine, ‘ic_mine_normal’, ‘ic_mine_selected’, 3), ], Add […]