Angular is among the best Front-end programming languages with superpowers. Preferred mostly for enterprise applications but with new versions of Angular comes new challenges and bugs on both Windows computers and other operating systems. Today I will guide you on how to install Angular on window step by step.
If you prefer to watch video tutorials below is a video tutorial to guide you otherwise continue reading.
Before we get started, I just like to point out that you need an internet connection to ensure you have a stable internet connection.
Step by Step Guide
Step 1. Install Node
Ensure that you do not have nodejs installed on your Windows machine, you can check that by typing “node -v” on your windows terminal (CMD). But if you have node installed already on your windows computer then run “npm install -g npm” to update it to the latest.
If your computer is fresh and does not have a node installed then download the node from this website https://nodejs.org/en/download/. When you visit, choose “recommended for most users”. This will download the ode on your computer. Install it the same way you would any other application.
Step 2. Install Angular CLI
Now that you have installed the node on your windows computer the next step is to install angular CLI to do that we visit angular.io, then click on “getting started” and then on the left-hand side of the screen click on “setup”. This should show you a screen like this
Now in your windows terminal (CMD) copy and run this code
npm install -g @angular/cli
this will install angular CLI on your computer. After installing you can confirm that you have correctly installed angular on your windows machine by running this command “ng version” this will show you a screen like the image below
Step 3. Create a test project
Let’s create one Angular test project to confirm that all our installations are working.
To do this, inside your windows terminal, navigate to the directory where you want your angular projects to be stored e.g my document or Desktop. Then type “ng new” followed by the project name i.e “ ng new projection”. if I hit enter it’s gonna ask me do I want to enable routing yes
it’s gonna ask me to choose which style sheet I want CSS and CSS for now I’m going to just choose. You can select by navigating using your up and down arrow key so for now, I’m just going to hit the enter button on CSS so it’s going to create the new project for me in the current directory that I am.
NOTE: this might take a few minutes depending on your internet connection but when it’s done creating your new project, you should see something like this.
Congratulations again, you have just created your first project in Angular. Next, we need to set the Execution Policy.
Step4. Set Execution policy
this step is often missed or ignored but sometimes this causes an “ng PSI error” when you try to create components in your IDE e.g Visual studio code because this is turned off by default so you have to set it. And to do that we just make sure you are in your Angular project directory and then run the following command inside the visual studio code terminal or your normal windows terminal.
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned
If you are not getting it right or having difficulties on your side, please watch the video tutorial. This will guide you also in common errors/issues you may encounter.youtube video
To run your application just navigate to your application directory in your terminal (CMD) and run “ng serve” this should build and spin up your application in something like this localhost:4200.
Congratulations again, you have completed the angular setup on your windows computer.
If you’ve installed angular before and you’re having “ng command not found” issues I have written a detailed step to fix it here. Also if you want to completely uninstall angular globally from your mac computer, I have written a step-by-step guide to uninstall mac completely from your mac and also made a video that will guide you.
Don’t forget to leave us a comment in the comment section below, like our videos, if you don’t like them please hit the dislike button I’m sure you won’t do that lol, it helps us grow.
If you enjoyed this post, we’ll be very grateful if you’d help spread it by sharing it with your friends using the share button. you can also get our latest updates by following us on Facebook, Twitter, Linkedin, and Instagram. Don’t forget to subscribe to our youtube channel for more Tech Tutorials, Tech reviews, and Tech reviews.