How to Install Angular on Mac and Windows

How to Install Angular on Mac and Windows

Angular is a powerful framework for building dynamic web applications. Whether you’re using a Mac or a Windows machine, getting Angular up and running is straightforward. This guide will walk you through the installation process for both operating systems.

Prerequisites

Before you start, ensure you have the following installed:

  • Node.js: Angular requires Node.js. You can download it from the official Node.js website.
  • npm: Node.js comes with npm (Node Package Manager), which you'll use to install Angular CLI.

Installing Angular on Windows

Step 1: Install Node.js and npm

First, download the Node.js installer for Windows from the official Node.js website. Run the installer and follow the prompts. The installation includes npm.

Step 2: Verify Installation

Open Command Prompt and verify the installation by running:

node -v
npm -v

These commands should return the installed versions of Node.js and npm.

Step 3: Install Angular CLI

Next, install the Angular CLI globally using npm:

npm install -g @angular/cli

Verify the Angular CLI installation:

ng version

Step 4: Create a New Angular Project

Now, create a new Angular project:

ng new my-angular-app cd my-angular-app

Serve your application:

ng serve

Open your browser and navigate to http://localhost:4200 to see your new Angular app in action.

For more detailed steps, you can refer to this guide from Radixweb.

Installing Angular on Mac

Step 1: Install Homebrew (Optional)

Homebrew is a package manager for macOS that makes installing software easier. To install Homebrew, open Terminal and run:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Step 2: Install Node.js and npm

Using Homebrew, you can install Node.js:

brew install node

Alternatively, you can download the Node.js installer directly from the official Node.js website.

Step 3: Verify Installation

Check the installation by running:

node -v
npm -v

Step 4: Install Angular CLI

Install Angular CLI globally:

npm install -g @angular/cli

Verify the installation:

ng version

Step 5: Create a New Angular Project

Create and navigate into a new Angular project:

ng new my-angular-app
cd my-angular-app

Serve your application:

ng serve

Navigate to http://localhost:4200 in your browser to see your Angular application.

Conclusion

Setting up Angular on both Mac and Windows is straightforward once you have Node.js and npm installed. With Angular CLI, you can quickly scaffold new projects and start building robust web applications.

For more information, check out the official Angular documentation.

Thanks for Reading!

If you enjoyed this article and found it useful, and you'd like to explore more on coding, feel free to support me by buying me a coffee ☕️ or by following me on Instagram @bilalelmahdaoui and X (formerly Twitter) @bilalelmahdaoui. I regularly post updates, insights, videos, and podcasts, all focused on the latest in Angular. Stay tuned and don’t miss out on what’s happening! ✨