Install Node.js and the Angular CLI

Angular Tutorial: Beginner to Advanced · 1. Getting started · 3 min read · Updated

Before you can build an Angular app you need three things on your computer: Node.js, the Angular command-line tool (the CLI), and a code editor. This lesson walks through each one and shows how to confirm that everything works.

What you will learn

  • What Node.js and npm do in an Angular project
  • How to install the Angular CLI
  • How to check your setup and fix common errors

What you need

  • Node.js runs the build tools on your computer. It comes with npm, the package manager that downloads libraries.
  • The Angular CLI is the ng command that creates, serves, tests and builds projects.
  • A code editor. Visual Studio Code is a popular free choice. Install the "Angular Language Service" extension for better hints in templates.
  • A terminal. Any terminal works, including the one built into your editor.

Step 1: Install Node.js

Download the current LTS version from nodejs.org and run the installer. Angular only supports certain Node versions. At the time of writing, Angular 22 needs Node 22.22.3 or newer, 24.15 or newer, or 26 and above. If your version is too old, the CLI stops with a message telling you the minimum version.

Check what you have installed:

node -v
npm -v

Both commands should print a version number.

Step 2: Install the Angular CLI

npm install -g @angular/cli

The -g flag installs it globally, so the ng command works from any folder. Check that it works:

ng version

You should see a banner with the CLI version, your Node version and a table of Angular packages. Inside a project the table lists the installed Angular packages as well.

Step 3: Check your editor

Open your editor and its built-in terminal. Make sure ng version works there too. If it does, you are ready for the next lesson.

Fixing common problems

  • "ng is not recognized" or "command not found": the terminal cannot find the CLI. Close and reopen the terminal, or make sure npm's global folder is on your PATH.
  • Permission errors (EACCES) on install: avoid using sudo with npm. Install Node with a version manager such as nvm, which keeps everything in your user folder.
  • "The Angular CLI requires a minimum Node.js version": your Node is too old. Install a newer LTS release and run the command again.
  • Slow or failing installs behind a company proxy: configure npm with your proxy settings, or ask your IT team for the registry address.

Try it yourself

  1. Run node -v, npm -v and ng version, and write down the three versions.
  2. Open the Angular documentation at angular.dev and find the "Installation" page.
  3. Create a folder for this course, such as angular-course, and open it in your editor.

Quick check

  1. Which tool downloads libraries for your project?
  2. What does the -g flag do in npm install -g?
  3. What should you do if the CLI says your Node.js version is too old?

Next, continue with Angular Course Roadmap and Complete Topic Index (Beginner to Advanced).

Frequently asked questions

Which Node.js version should I use for Angular?

Use a current LTS version that your Angular release supports. Each Angular version lists the Node versions it accepts, and the CLI will tell you if yours is not supported.

Do I need to install Angular separately in every project?

The CLI is installed once. Each project you create gets its own copy of the Angular libraries inside its node_modules folder.