Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to find my angular version in my project?

I have setup the angular code on my local machine. I need to know the version of the angular that I am using in the project. how can I easily find it in cmd prompt?

like image 416
Vignesh Kasthurisamy Avatar asked Jun 12 '17 15:06

Vignesh Kasthurisamy


People also ask

How do you check Angular is installed or not?

Go to your folder path in cmd where your angular is installed and type ng --version it will show your angular version.

How do I switch between Angular versions?

You can try this out in your own application. Open your command line in the directory containing your application's package. json folder and execute npm run ng serve. You can also experiment by running ng -v then npm run ng -v which will run the version of your global and local Angular-CLIs.


2 Answers

There are several ways you can do that:

  1. Go into node_modules/@angular/core/package.json and check version field.
  2. If you need to use it in your code, you can import it from the @angular/core:

    import { VERSION } from '@angular/core';

  3. Inspect the rendered DOM - Angular adds the version to the main component element:

    <my-app ng-version="4.1.3">

like image 85
Max Koretskyi Avatar answered Sep 17 '22 21:09

Max Koretskyi


try this command :

ng --version 

It prints out Angular, Angular CLI, Node, Typescript versions etc.

like image 42
Mohamed Ali RACHID Avatar answered Sep 17 '22 21:09

Mohamed Ali RACHID