Thursday, February 16, 2017

Electron - Installation

To get started with developing using the Electron, you need to have Node and npm(node package manager) installed. If you don’t already have these, head over to Node setup to install node on your local system. Confirm that node and npm are installed by running the following commands in your terminal.

node --version
npm --version
You should get the output:
v6.9.1
3.10.8
Whenever we create a project using npm, we need to provide a package.json file, which has all the details about our project. npm make it easy for us to set up this file. Let us set up our development project.
  1. Fire up your terminal/cmd, create a new folder named hello-world and cd into it.
  2. Now to create the package.json file using npm, use the following.
    npm init
  3. It’ll ask you for the following information:
    Package.json creation Just keep pressing enter, and enter your name at the “author name” field.
Create a new folder and cd into it. Now run the following command to install Electron globally.
$ npm install -g electron-prebuilt
Once it executes you can check if electron installed correctly by running:
$ electron --version
You should get the output:
v1.4.13
Now that we've set up electron, lets move on to creating our first app using it!

No comments:

Post a Comment