Getting Started with Electron: Building Desktop Apps for Web Developers

Setting Up Your Development Environment

Section 2

Chapter 1: Welcome to the Desktop: Your First Electron App

Getting Started with Electron: Building Desktop Apps for Web DevelopersChapter 1: Welcome to the Desktop: Your First Electron App

Welcome to the exciting world of desktop application development with Electron! As web developers, you already possess a fantastic skillset that directly translates to building native desktop apps. This chapter will guide you through setting up your development environment so you can quickly get your first Electron app up and running.

Before we dive into writing code, we need to ensure you have the necessary tools installed. Electron apps are essentially web pages bundled into a desktop application, so our primary dependencies are Node.js and npm (Node Package Manager), which comes bundled with Node.js.

The first step is to install Node.js. If you don't have it already, head over to the official Node.js website (https://nodejs.org/) and download the LTS (Long Term Support) version for your operating system. The LTS version is recommended for most users as it's the most stable.

Once Node.js is installed, you can verify the installation by opening your terminal or command prompt and running the following commands:

node -v
npm -v

These commands should output the installed versions of Node.js and npm, respectively. If you see version numbers, you're good to go!

Now that Node.js and npm are set up, we can create a new directory for our first Electron project. Navigate to your desired location in the terminal and create a new folder. Then, change into that directory.

mkdir my-first-electron-app
cd my-first-electron-app
チャプターへ戻る