3d cartoon hands holding a phone

Unlock full course by purchasing a membership

Lesson 1

Basic Environment Setup

STANDARD

Basic Environment Setup

Before we can install and start building an application with the Angular CLI — the command line interface provided by Angular to help create and build apps — we need to get everything set up on our computer first. The key things we will need to do are:

  • Install NodeJS (you may already have this installed)
  • Install the Angular CLI

Installing Node (for Windows users)

You will find when working in web development that most of what you find is oriented toward a macOS/Linux environment. If you are using a Windows machine, and some tutorial tells you to run a command in the terminal, you might often be disappointed when it doesn’t actually work for you.

IMPORTANT: If you are using a macOS or Linux-based operating system, then you can skip straight to the Installing Node Installing Node (for macOS/Linux) section that follows this one.

In the past, it has been awkward to do web development on Windows but now with WSL (Windows Subsystem for Linux) things are a lot easier. There are some steps required to get set up though. I would recommend:

  1. Watching this video for a general introduction and advice. This video contains additional tips you don’t specifically need but are great quality-of-life improvements

Make sure to follow the steps outlined for installing Node on Windows. When completing this course, you should use WSL and not the standard Windows terminal.

If you are already experienced and have your own preferred way for developing on your Windows machine, feel free to ignore this section!

Installing Node (for macOS/Linux)

If you are using macOS/Linux then you will generally have an easier time getting set up. To install Node, all you need to do is visit the NodeJS website and download the LTS version of node.

Install the Angular CLI (Command Line Interface)

Once you have NodeJS installed, you will be able to access the node package manager or npm through your command terminal. This will allow you to install the Angular CLI.

Keep in mind that the Angular framework and the Angular CLI are two different things. You aren’t actually installing the Angular framework, just the CLI. After you have installed the CLI, you will use it to generate a project that includes the Angular framework.

Install the Angular CLI by running the following command in your terminal:

npm install -g @angular/cli

It is better to install global packages like this with standard permissions, but if you get permission errors you can also force an install with:

sudo npm install -g @angular/cli

To ensure that the Angular CLI has been installed successfully, you can run the following command to check:

ng version

This should output the current version of the Angular CLI that you have installed.

The ng command is what we will use to execute commands through the Angular CLI.