How to install Angular on Windows 11 or 10 using command prompt

Those who are in development would already know about Angular which is an open-source framework built for developing dynamic web applications. It is developed by Google and is cross-platform in nature. Well, whether you’re a seasoned developer or just starting with Angular, the first step is we have to install it. So, in this guide, we will provide the commands that you can use to install Angular on Windows 10 or 11 just like we do on Linux systems.  

But why to use Angular?

Before we dive into the installation process, let’s quickly know some benefits of using Angular, making it worth considering for web development. Angular offers a robust and structured framework for building modern web applications. It’s known for:

  • Its component-based architecture allows you to build and maintain complex applications with ease.
  • Web applications created using Angular work seamlessly on various platforms and devices.
  • Angular optimizes your application for better performance, making it load quickly and run smoothly.
  • Active community, availability of ample resources, tutorials, and support for Angular development.

Step 1. Open PowerShell or CMD as Admin

Here we are using PowerShell but you can use the Command prompt as well because the steps will be the same in both. However, just make sure you are accessing them as Admin because we need Superuser rights for installing applications using the command line.

Nevertheless,  to give an idea – just click on the Windows start button and search for PowerShell or CMD, after that click on the option – “Run as Administrator

Running Powershell as Admin for Windows 11

Step 2. Check Winget Available

On all Windows 11 including the latest version of Windows 10 users will have Microsoft’s package manager called Winget. However, to confirm its presence on your system, type the given command after opening Powershell or CMD.

winget -v

You will see the current version of the package manager in the output, confirming it is available to use.

Step 3. Install Node.js & NPM

First, we need to have Node.js and its package manager NPM (Node Package Manager) on our Windows 10 or 11 system. We need NPM to not only install Angular but also to get the tools we require to build our web applications.

So, using your Winget install the Nodejs with that NPM will be on your system automatically. The latest version of Node was 20 while doing this article but Angular supports only the LTS version, hence we are going for the 18.x version of Node.js.

winget install OpenJS.NodeJS.LTS

Wait for a few seconds, the system will set this JavaScript runtime environment for you,

Now, close your command terminal or PowerShell and open it again, so that the Node & NPM command tools can be recognized by the system. To check the version of installed Node and NPM you can use:

node -v
npm -v

Also, it’s essential to keep things up to date. You can update npm by running the following command in your terminal:

npm install -g npm@latest
Install Nodejs and NPM on Windows

Step 4. Installing Angular CLI on Windows 10 or 11

Angular CLI (Command Line Interface) on Windows simplifies the process of creating, building, and deploying Angular applications. To install it, follow these steps:

You would already have Windows Command Prompt or PowerShell with administrator privileges. Hence, just run the following command to install Angular CLI globally:

npm install -g @angular/cli

Once the installation is completed, you can verify the installation by checking the Angular CLI version:

However, before checking the version of Angular, enable the execution of PowerShell scripts which is disabled by default. Without you would be able to run ng tool commands. So, run:

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

Press Y and hit the Enter key.

After that run:

ng version

You should see the version of Angular CLI that you have installed.

Note: If you get the command not found then close and open your PowerShell or CMD again.

Check Angular Version in Windows 10 or 11

Step 5. Creating Your First Angular Project

Now, that we have the Angular CLI installed on our Windows 11 or 10 system, it is time to start with the initial step, and let’s create a simple Angular project to understand how it works.

Create a directory where you want to save your Angular project file, let’s say – MyApp

mkdir myapp

Now switch to this directory using the cd command in your terminal.

cd myapp

Run the following command to generate a new Angular project:

ng new my-first-app

Replace “my-first-app” with your desired project name.

Angular CLI will prompt you to choose some configuration options for your project. You can choose the default options for now by pressing the Enter key.

Creating Your First Angular Project

Once the project is generated, navigate into the project folder:

cd my-first-app

Finally, start the Angular development server by running:

ng serve
start Angular development server

This will compile your Angular application and make it available for preview at http://localhost:4200/. Open your browser and point to that.

Installing Angular on Windows 10 or 11 using CMD

6. Uninstallation (optional)

In case after some time you want to remove the Angular from your Windows using Powershell or CMD terminal, then here are the commands to follow:

To remove only Angular:

npm remove -g @angular/cli

To remove Nodejs and NPM:

winget uninstall OpenJS.NodeJS.LTS

Conclusion

In this way, we can easily use the command prompt of Windows 10 or 11 to not only install Angular but also to create projects and manage them. This open-source framework is quite powerful for building modern web applications, and with the right installation and setup, you’re well on your way to becoming an Angular developer.

Other Articles: