Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check which version of Angular I'm using?

How can I tell which version of Angular I am using?

I have tried:

angular --version
angular --v
angular -version
angular -v

but get -bash: angular: command not found

I know by yeoman --version that I am using 0.9.6

But how do get the angularjs version?

like image 346
FluxEngine Avatar asked Apr 15 '13 14:04

FluxEngine


People also ask

How do I know which version of angular I am using?

Checking the Angular VersionOpen the Terminal + view in your project and type ng --version . For recent versions of Angular, this will list the versions of several Angular packages that you have installed in your project.

How do I know what version of angular 11 I have?

Use the command ng --version (or ng -v ) to find the version of Angular CLI in the current folder. Run it outside of the Angular project, to find out the globally installed version of Angular.

What is the version of angular?

Version 12 Angular 12 was released on May 12, 2021.

How do I know if I have angular?

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


21 Answers

For Angular 1 or 2 (but not for Angular 4+) :

you can also open the console on the developer tools of whatever browser you use and type angular.version to access the Javascript object that holds angular version.

Very useful when the script is minified with no header comment.

like image 164
lolski Avatar answered Oct 08 '22 15:10

lolski


Edit: When this answer was written, there was only AngularJS 1.x. Look in the answers below for Angular versions >= 2.

AngularJS does not have a command line tool.

You can get the version number from the JavaScript file itself.

Header of the current angular.js:

/**
 * @license AngularJS v1.0.6
 * (c) 2010-2012 Google, Inc. http://angularjs.org
 * License: MIT
 */
like image 31
TheHippo Avatar answered Oct 08 '22 14:10

TheHippo


For Angular 2+, in any modern browser having developper tools (F12) you can inspect the top level application tag.

For Internet Explorer 11 or Edge you can find information here :Angular version Number

Works for Angular 2+ Chrome browser

enter image description here

Firefox firebug

enter image description here

like image 37
Tony Dong Avatar answered Oct 08 '22 13:10

Tony Dong


If you are using angular-cli, then you can check it easily by typing

ng -v

or ng v in Angular 8, in Terminal or Bash. Note: Run the command within the project directory.

You should get something like this:

angular-cli: 1.0.0-beta.24
node: 7.4.0
os: darwin x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/router: 3.4.3
@angular/compiler-cli: 2.4.3
like image 21
István Avatar answered Oct 08 '22 14:10

István


In the browser's developer console (press F12 to open it), you can type the following,

angular.version.full

it will give you the full version, e.g. (depending on your current version). [It actually gets the full property of angular.version object.]

"1.4.3"

So, to see the full object, if you type

angular.version

It will give you the full version object containing version information like full, major, minor and also the codeName, e.g.

Object {full: "1.4.3", major: 1, minor: 4, dot: 3, codeName: "foam-acceleration"}
like image 23
Suman Barick Avatar answered Oct 08 '22 13:10

Suman Barick


You could also check your package.json:

"dependencies": {
    "@angular/common": "^5.0.0",
    "@angular/compiler": "^5.0.0",
    "@angular/core": "^5.0.0",
    "@angular/forms": "^5.0.0",
    "@angular/http": "^5.0.0",
    "@angular/platform-browser": "^5.0.0",
    "@angular/platform-browser-dynamic": "^5.0.0",
    "@angular/router": "^5.0.0",
  }

(The caret ^ will update you to the most recent major version (the first number). ^4.3.0 will match any 4.x.x release including 4.4.0, but will hold off on 5.0.0. The tilde ~ matches the most recent minor version (the middle number). ~4.3.0 will match all 4.3.x versions, but will miss 4.4.0.)

like image 44
Leo Avatar answered Oct 08 '22 15:10

Leo


Now it is ng -v

If you are useing angular cli then you can check useing

ng --version

Now it is ng -v

Or you can also check in

pakage.json file

 "dependencies": {
    "@angular/animations": "^4.0.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "angular-in-memory-web-api": "^0.3.2",
    "core-js": "^2.4.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"
  },
like image 20
Sagar Jethi Avatar answered Oct 08 '22 15:10

Sagar Jethi


There are many way, you check angular version Just pent the comand prompt(for windows) and type

1. ng version
2. ng v
3. ng -v

check the angular version using comand line

4. You can pakage.json file

check the angular version on pakage.json file

5.You can check in browser by presing F12 then goto elements tab

check the angular version on your browser

Full understanding of subversion about(x.x.x) please see angular documentation angularJS and angular 2+

like image 25
Srikrushna Avatar answered Oct 08 '22 13:10

Srikrushna


Another way would be to import VERSION constant from @angular/core and then dumping to console with:

console.log(VERSION.full); //5.2.11

Works in:

  • Angular 8 See docs
  • Angular 7 See docs
  • Angular 6 See docs.
  • Angular 5 See docs
  • Angular 4 See docs

Not sure about Angular 2 and 3. (if someone could test that; pages are not available)


For AngularJS 1.x use angular.version:

console.log(angular.version); //1.7.4
like image 30
erikvimz Avatar answered Oct 08 '22 13:10

erikvimz


To Angular 4, many of the options no longer work. Update July 2017 Two posibilities:

1) The simplest one is to open the package.json of our project and to check the versions used, among them the one of Angular.

enter image description here

2) After executing ng serve, we open the inspector of elements of the explorer that we use and we can observe the version as in the following image.

enter image description here

like image 40
Hugo L.M Avatar answered Oct 08 '22 14:10

Hugo L.M


Just Run ng v in command

You will get result like

Angular CLI: 7.3.9
Node: 12.11.0
OS: win32 x64
Angular: 7.2.15
... common, compiler, compiler-cli, core, f
... language-service, platform-browser, pla
... router

Package                           Version
-------------------------------------------
@angular-devkit/architect         0.13.9
@angular-devkit/build-angular     0.13.9
@angular-devkit/build-optimizer   0.13.9
@angular-devkit/build-webpack     0.13.9
@angular-devkit/core              7.3.9
@angular-devkit/schematics        7.3.9
@angular/cli                      7.3.9
@ngtools/webpack                  7.3.9
@schematics/angular               8.0.0
@schematics/update                0.13.9
rxjs                              6.5.3
typescript                        3.1.6
webpack                           4.29.0
like image 36
Pullat Junaid Avatar answered Oct 08 '22 15:10

Pullat Junaid


For Angular 1 or 2 (but not for Angular 4+):

You can also open the console and go to the element tab on the developer tools of whatever browser you use.

Or

Type angular.version to access the Javascript object that holds angular version.

For Angular 4+ There is are the number of ways as listed below :

Write below code in the command prompt/or in the terminal in the VS Code.(up to 3)

  1. ng version or ng --version (Find the image for the reference)
  2. ng v
  3. ng -v

In the terminal you can find the angular version as shown in the attached image : enter image description here

  1. You can also open the console and go to the element tab on the developer tools of whatever browser you use. As displayed in the below image :

enter image description here

  1. Find the package.json file, You will find all the installed dependencies and their version.
like image 20
Trilok Pathak Avatar answered Oct 08 '22 14:10

Trilok Pathak


If you are using angular-cli, simply use command:

ng v
like image 44
Mwiza Avatar answered Oct 08 '22 14:10

Mwiza


Attention: The following only checks the Angular-CLI version!!!:

Both commands work:

ng -v

or

ng v

enter image description here

like image 43
Legends Avatar answered Oct 08 '22 13:10

Legends


For angular 4+ use,

  • ng version
  • ng v

Please note ng -v option does not work in Angular 7+.

like image 26
javapedia.net Avatar answered Oct 08 '22 13:10

javapedia.net


For AngularJS - Use angular.version

console.log(angular.version);
<script src="//unpkg.com/angular/angular.js"></script>

For more information, see

  • AngularJS API Reference - angular.version
like image 21
georgeawg Avatar answered Oct 08 '22 14:10

georgeawg


If you are using VS Code editor .

Go to Explorer panel on left side -> find package.json & open it -> under dependencies find @angular/core.

This is your angular version as core is the main feature

enter image description here

enter image description here

like image 25
V K Avatar answered Oct 08 '22 14:10

V K


On your project folder, open the command terminal and type

ng -v

it will give you a list of items, in that you will be able to see the angular version. See the screenshot.

version details

like image 30
Akbar Badhusha Avatar answered Oct 08 '22 14:10

Akbar Badhusha


version after angular 2 you can use from terminal,

ng -v



    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.7.3
Node: 9.3.0
OS: linux x64
Angular: 5.2.9
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.7.3
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0
mohideen@root:~/apps/UI$ 
like image 38
Mohideen bin Mohammed Avatar answered Oct 08 '22 15:10

Mohideen bin Mohammed


There are multiple ways:

  1. You may verify it from your package.json file
  2. You use the following command:

ng --version

The command above will result in the following output:

Angular CLI: 7.0.3

Node: 9.4.0

OS: darwin x64

Angular: 7.0.1

... animations, common, compiler, compiler-cli, core, forms

... http, language-service, platform-browser

... platform-browser-dynamic, router

Package Version


@angular-devkit/architect 0.10.3

@angular-devkit/build-angular 0.10.3

@angular-devkit/build-optimizer 0.10.3

@angular-devkit/build-webpack 0.10.3

@angular-devkit/core 7.0.3

@angular-devkit/schematics 7.0.3

@angular/cli 7.0.3

@ngtools/webpack 7.0.3

@schematics/angular 7.0.3

@schematics/update 0.10.3

rxjs 6.3.3

typescript 3.1.4

webpack 4.19.1

So, the version of Angular, Angular CLI, Node and many other packages can be verified from here.

like image 38
Bilal Ahmed Yaseen Avatar answered Oct 08 '22 13:10

Bilal Ahmed Yaseen


just go to your angular project directory via terminal and ng -v give all information like this

Angular CLI: 1.7.4
Node: 8.11.1
OS: linux x64
Angular: 5.2.11
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.7.4
@angular-devkit/build-optimizer: 0.3.2
@angular-devkit/core: 0.3.2
@angular-devkit/schematics: 0.3.2
@ngtools/json-schema: 1.2.0
@ngtools/webpack: 1.10.2
@schematics/angular: 0.3.2
@schematics/package-update: 0.3.2
typescript: 2.5.3
webpack: 3.11.0

If you check ng-v outside angular project directoty then it will show only angular-cli version.

like image 31
Kamal Kumar Avatar answered Oct 08 '22 15:10

Kamal Kumar