angular
/

Angular Environment Setup – Getting Started

Last Sync: Today

On this page

5
0%
5 min read
Remaining
5 minleft

Click any section to jump — progress syncs automatically

angular

Angular Environment Setup – Getting Started

Preparing Your Workspace

To begin building with Angular, you need a robust local development environment. As a Technical Lead, ensuring your environment matches your production build is key to avoiding 'it works on my machine' issues. The Angular ecosystem relies heavily on Node.js and NPM (Node Package Manager) to manage dependencies and build tools.

  1. Prerequisites: Node.js and NPM

Before installing Angular, you must have Node.js installed. Angular typically requires an LTS (Long Term Support) version. Installing Node.js automatically installs NPM, which Angular uses to fetch libraries like RxJS and Zone.js.

BASHRead-only
1
# Check your current versions
node -v
npm -v

  1. Installing the Angular CLI

The Angular Command Line Interface (CLI) is the backbone of Angular development. It handles project initialization, code generation (components, services), and the build process. You install it globally using NPM.

BASHRead-only
1
# Install Angular CLI globally
npm install -g @angular/cli

# Verify the installation
ng version

  1. Creating Your First Project

With the CLI installed, you can generate a new workspace. The CLI will ask you configuration questions regarding CSS preprocessors (like SCSS) and whether you want to enable Server-Side Rendering (SSR).

BASHRead-only
1
# Create a new project named 'revo-web'
ng new revo-web

# Navigate into the folder
cd revo-web

# Start the development server
ng serve --open

Angular Project Structure

A standard Angular workspace is organized to support modularity and scalability.

File/FolderPurpose
src/appContains the main logic, components, and modules.
src/assetsStatic files like images, icons, and configuration JSONs.
angular.jsonCLI configuration for build, serve, and test commands.
package.jsonLists project dependencies and custom scripts.
tsconfig.jsonTypeScript compiler settings for the project.

Test Your Knowledge

Q1
of 3

Which command is used to install the Angular CLI globally?

A
ng install cli
B
npm install -g @angular/cli
C
npm start angular
D
ng new cli
Q2
of 3

What is the default port for the Angular development server?

A
3000
B
8000
C
4200
D
5000
Q3
of 3

Which file contains the configuration for the Angular CLI build process?

A
package.json
B
angular.json
C
tsconfig.json
D
main.ts

Frequently Asked Questions

What is the difference between 'npm install' and 'ng new'?

'npm install' fetches specific libraries into an existing project. 'ng new' is a scaffolding command that creates the entire directory structure, configuration files, and initial boilerplate for a fresh Angular app.

Why use SCSS instead of plain CSS?

As an architect, SCSS is recommended for large projects because it supports variables, nesting, and mixins, making your styles more maintainable and DRY (Don't Repeat Yourself).

How do I fix 'ng: command not found'?

This usually means your NPM global binaries folder isn't in your system's PATH. You may need to add the path manually or reinstall the CLI with administrative privileges.

Previous

angular introduction

Next

angular architecture

Related Content

Need help?

Explore our comprehensive docs or start a chat with our tech experts.