Exercise 1: Hello Electron! (Part 1)
There are several "boilerplate" projects that provide a great framework for building Electron apps. However, starting with a boilerplate can be overwhelming, because you are having to learn both Electron and the boilerplate project at the same time.
In my opinion, it's better to start by simply learning Electron. Then, once you have a good foundation in Electron, you will better understand the challenges these boilerplate projects solve.
- Install Node.js
- Install Visual Studio Code
- Optional: Git
- Open Terminal / Command Window
- Change current directory to your Documents or where you store software projects
- Create a new directory for the project
Mac:
cd ~/Documents
mkdir electron-workshop
Windows:
cd "%userprofile%\My Documents"
md electron-workshop
cd electron-workshop
npm init -y
Note:
npm init
creates a newpackage.json
file. It's okay to choose the defaults. You can edit thepackage.json
later, if you wish.
npm install --save-dev electron
Note: Every
npm install
in these exercises should be run from command line, from the root of your project directory.
Note: If there is an issue downloading electron, you can add the
--verbose
switch to see more details.
We will work together to finish Exercise 1 in Part 2!