← Back to the seriesThe Galactic Guide to Angular Β· 2 / 10

Installation and setup

Installation and setup

Welcome to the second chapter of our Angular guide!


Before writing code, we need to prepare our development environment. Do not worry: we will follow every step together, whether you have a Mac or a Windows PC.


By the end of this chapter, you will have everything you need to develop with Angular professionally: Node.js, Angular CLI, a configured VS Code and Git ready to use.


πŸ“‹ What we will install


Here are the tools we need and why they matter:


🟒 Node.js: the engine behind everything


Node.js is a runtime environment that runs JavaScript outside the browser. JavaScript normally runs in web pages, but Node.js brings it to your computer, allowing you to:


  • Use development tools written in JavaScript (such as Angular CLI).
  • Run build and automation scripts.
  • Install packages and libraries.

Why do we need it for Angular? Angular CLI (the tool for creating projects) is written in JavaScript and needs Node.js to run. We will also use Node.js for the local development server.


πŸ“¦ npm: the package warehouse


npm (Node Package Manager) is the "store" where you can find millions of ready-to-use JavaScript packages. Think of it as the App Store for developers: rather than downloading apps, you download code libraries others have written and shared.


What will we do with npm?

  • Install Angular CLI.
  • Add libraries to our project (icons, UI components, utilities).
  • Manage dependencies automatically.

🌿 Git: a time machine for code


Git is a version control system: it tracks every change to your code over time.


What can you do with Git?

  • Save snapshots of your project.
  • Go back to earlier versions if something breaks.
  • Work in a team without overwriting other people's work.
  • Experiment with features in separate branches.

πŸ›  The other tools


  • Angular CLI: the official tool for creating and managing Angular projects.
  • VS Code: the code editor (with the right extensions).

🍎 Installation on macOS


1. Install Node.js on macOS


Option A: direct download (recommended for beginners)

  1. Visit nodejs.org.
  2. Download the LTS (Long Term Support) version, the recommended option.
  3. Open the downloaded .pkg file and follow the installation wizard.
  4. Restart the terminal.

Option B: Homebrew (if you already use it)

BASH
1# Install Homebrew if needed
2/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
3
4# Install Node.js
5brew install node

To check the installation, open the terminal and type:

BASH
node --version
npm --version

You should see something like:

BASH
v20.15.0
10.7.0

2. Install Angular CLI on macOS


In the terminal, run:

BASH
npm install -g @angular/cli

The -g flag installs Angular CLI globally, so you can use it from any folder. Check the installation:

BASH
ng version

You should see Angular CLI version information.


3. Install VS Code


  1. Visit code.visualstudio.com.
  2. Download the macOS version.
  3. Open the .zip file and drag the app into Applications.
  4. Launch VS Code.

4. Install Git


Option A: direct download

  1. Visit git-scm.com.
  2. Download the macOS version.
  3. Follow the installation wizard.

Option B: Homebrew

BASH
brew install git

Check the installation:

BASH
git --version

πŸͺŸ Installation on Windows


1. Install Node.js on Windows


  1. Visit nodejs.org.
  2. Download the LTS version for Windows.
  3. Run the .msi file and follow the installation wizard.
  4. βœ… Important: make sure "Add to PATH" is selected during installation.

To check the installation, open Command Prompt (cmd) or PowerShell and type:

POWERSHELL
node --version
npm --version

2. Install Angular CLI on Windows


In Command Prompt:

POWERSHELL
npm install -g @angular/cli

Possible Windows issues If you get permission errors, try:

POWERSHELL
# Open PowerShell as administrator
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
npm install -g @angular/cli

Check the installation:

POWERSHELL
ng version

Fullstack developer in Milan. Writes about Angular, the JavaScript ecosystem and AI.