Angular CLI is a powerful command-line tool that simplifies the process of creating, managing, and deploying Angular applications. Ensuring that you have the latest version of Angular CLI installed is crucial to taking advantage of its latest features and improvements. In this article, we will explore how to check the Angular CLI version installed on your system using the command prompt or terminal.
Checking Angular CLI Version
Follow these steps to check the version of Angular CLI installed on your system:
Step 1: Open the Command Prompt or Terminal
Depending on your operating system, open the command prompt or terminal:
- Windows: Press
Win + R
to open the Run dialog, typecmd
, and press Enter. - macOS: Press
Cmd + Space
to open Spotlight, typeTerminal
, and press Enter. - Linux: Press
Ctrl + Alt + T
to open the terminal.
Step 2: Run the Angular CLI Version Command
In the command prompt or terminal, type the following command and press Enter:
bashCopy codeng version
Upon execution, the command will display information about the Angular CLI version installed on your system, along with the versions of Angular-related packages in your current project.
Example Output:
sqlCopy codeAngular CLI: 12.2.0
...
...
Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.1202.0
@angular-devkit/build-angular 12.2.0
@angular-devkit/core 12.2.0
@angular-devkit/schematics 12.2.0
@schematics/angular 12.2.0
rxjs 6.6.7
typescript 4.3.5
In this example, the Angular CLI version is 12.2.0.
Step 3: Update Angular CLI (Optional)
If you find that your Angular CLI version is outdated, you can update it by running the following commands:
First, uninstall the current global Angular CLI package:
bashCopy codenpm uninstall -g @angular/cli
Next, install the latest version of Angular CLI:
bashCopy codenpm install -g @angular/cli@latest
Now, if you run the ng version
command again, you should see the updated Angular CLI version.
Conclusion
Checking the Angular CLI version installed on your system is a simple process that can be done by running the ng version
command in the command prompt or terminal. By ensuring that you have the latest version of Angular CLI, you can take advantage of the newest features, enhancements, and bug fixes, leading to a more efficient and streamlined development process for your Angular applications.