Install Node.js and Angular CLI, Create Your First Project

Angular 12 min min read Updated: Nov 16, 2026 Beginner
Install Node.js and Angular CLI, Create Your First Project
Beginner Topic 2 of 5

What You Need

ToolNotes
Node.js (LTS)Runs the build tools. Download from nodejs.org. Check the Angular docs for the supported Node versions
npmComes with Node.js
Code editorVS Code with the Angular Language Service extension
BrowserChrome with Angular DevTools extension (helpful later)

Step 1: Check Node.js

bash ode --version npm --versio

Step 2: Install the Angular CLI

bash pm install -g @angular/cli ng versio

ng is the Angular command line tool. It creates projects, generates code, runs a development server, runs tests and builds for production.

Step 3: Create a Project

bash g new my-first-app cd my-first-app

The CLI asks a few questions. Good beginner answers:

QuestionChoose
Stylesheet formatCSS (simplest) or SCSS
Server-side rendering (SSR)No for now. We learn it later
AI tools / extrasSkip

Step 4: Run It

bash g serve --open # or: npm start

The browser opens http://localhost:4200. The page reloads automatically when you save a file.

Common CLI Commands

CommandDoes
ng new nameCreate a project
ng serveDevelopment server with live reload
ng generate component name (ng g c name)Create a component
ng g service nameCreate a service
ng g directive name / ng g pipe nameCreate a directive or pipe
ng buildProduction build into dist/
ng testRun unit tests
ng updateUpgrade Angular
ng add @angular/materialAdd a library with setup

Your First Change

Open src/app/app.html and replace its content:

html <h1>Hello Angular!</h1> <p>My first app is running.</p>

Save. The browser updates at once.

Common Problems

ProblemFix
ng is not recognizedClose and reopen the terminal. Check the npm global folder is in PATH
Permission error on install (macOS/Linux)Use a Node version manager such as nvm instead of sudo
Port 4200 busyng serve --port 4300
Wrong Node version messageInstall the Node LTS version that the Angular docs support
Use the CLI to generate code: ng generate creates files in the right place with the right names, so you do not make typing mistakes.

Conclusion

Install Node.js and the Angular CLI, create a project with ng new, run it with ng serve and edit files while the browser reloads automatically.

Quick Summary: npm i -g @angular/cli; ng new app; ng serve --open.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators