Electron Quick Start

Electron is a good choice to build cross platform desktop apps with JavaScript, HTML, and CSS. In this article, I will guide you to install all necessary packages, get electron-quick-start running and create the dist package.


node.js

First, you need install node.js. The v6.9.1 is used in my case.

1
2
$ node --version
v6.9.1

Fetch code

1
git clone https://github.com/electron/electron-quick-start.git

Install packages and run

1
2
3
cd electron-quick-start
npm install
npm start

In China, the installation process may suspend due to the problem of downloading electron binary package (version 1.7.10 in my case), even with taobao registry (https://registry.npm.taobao.org) enabled. One possible workaround is fetching the package directly and put in the cache directory, so the script install.js can uncompress the package without downloading.

1
2
cd ~/.electron
wget https://npm.taobao.org/mirrors/electron/1.7.10/electron-v1.7.10-darwin-x64.zip

Create the dist package

To create the dist package, electron-packager can be used to do the dirty work.

1
electron-packager electron-quick-start/ quick-start
文章目录
  1. 1. node.js
  2. 2. Fetch code
  3. 3. Install packages and run
  4. 4. Create the dist package
,