It is essential for any developer to check the Angular version before they start anything. This gives the developer an idea about what version modules the developers need to install for their projects and all. But what if you are not sure about the Angular version and wondering what version of Angular am I using? Then the question is how to check the Angular version?
Well, in this article I will be talking about it only. I will be sharing a step by step guide on how to find the Angular version and update it if you are not already on the latest version.
So let’s just quickly get into the topic without wasting much of the time:
What is the Angular? How to find angular version?
Talking about Angular, it is a front end and client-side framework. This means that the development and functionality of the browser are performed based on your browser and not by the server.
The programming framework was originally developed to support single-page applications or SPAs. However, with the competitive landscape of front end frameworks increasing, Angular pivoted to improve the product and expand its functionality into what we have today.
How to Check the Angular Version and update it to the latest version?
Now the question is, how to check the angular version? Well, let me just go ahead and below share a step by step guide which will help you to check the currently installed Angular CLI version.
So here we go:
Step 1: Check the Angular CLI Version
In the first step of this tutorial, we will be checking out the current version of Angular CLI installed on your local development machine. So for this launch command-line interface or CMD, if you are using Windows and then run these following commands:
$ ng –version
$ ng v
$ npm list –global –depth 0
Over here, the ng-version command will output the details of the installed Angular CLI version and the version of the Angular packages. Once you run the commands, your command-line interface should return with these details:
Angular CLI: 8.3.19
OS: win32 ia32
Over here, the npm list –global –depth 0 will print a list of all the packages installed on your computer at the top level. Also, you should get to see an output like this:
The ng v command is equivalent to the ng –version command. So as you can see, after running the command, we have @angular/cli v8.3.19 as the currently installed version of Angular on our machine.
Updating Angular CLI Version Globally
To update Angular CLI version globally in your system use the following commands
$ npm uninstall -g angular-cli
$ npm cache verify
$ npm install -g @angular/cli@latest
You can also install a specific version using the following command:
$ npm install -g @firstname.lastname@example.org
Here I’m installing Angular CLI v9.0.0-rc.2, the latest version as of this writing.
This is the output of ng v:
Angular CLI: 9.0.0-rc.2
OS: win32 ia32
Updating the Angular Version
There is also a quicker way to update the Angular version. This version is pretty useful when you are upgrading Angular to a major release.
As you already know that major releases contain significant changes, some steps are typically required.
For instance, you may have to run or update scripts, refactor code, run additional tests and learn new APIs. Luckily, the Angular website includes an interactive Angular Update Guide that lets you input your project specifics and then produces a detailed list of instructions.
Note: Before you update a major version to another, it is advised that you should not skip major versions. So follow the below instructions to incrementally update to the next major version, testing and validating at each step.
Anyway, to update to the latest Angular version, you can find the official guide over here: https://update.angular.io/.
Frequently Asked Questions and Answers
What is the current version of angular?
Angular 10 is the latest major version released in Jun 2021. This is a smaller release compared to other major releases because of just a four-month time from the previous major release v9. Also, it is a synchronized major release with Angular CLI 10 and Angular Material 10.
How do I know if AngularJS is installed?
To know this, you have to go to your folder path in cmd, where you have installed the Angular. Then you need to type and run ng –version it will show your angular version.
Is the Angular frontend or backend?
Angular is a complete frontend framework. As it doesn’t really have any capabilities that include any of the features that you find in a backend language. So you can only use Angular for all your frontend requirements.
So that was a quick answer to your question: what version of Angular am I using? I hope the above steps have helped you to find an angular version. So go ahead and try the steps out and see if they are working out for you or not. Also, if there is anything you would want to ask, then do feel free to comment below, and I will surely help you out.