231

Is there a way to check the specific version of angular-cli that's installed globally on my machine? I'm in a Windows environment. *npm -v* and *node -v* only gives me the version of npm and node respectively, and I can't seem to find any commands with ng.

I'm trying to run a project that I'm working on, and it ran on an older version of angular-cli using npm. However, after installing other demo projects, my main project doesn't work anymore without uninstalling and reinstalling angular-cli at the specific version.

Sarun UK
  • 6,210
  • 7
  • 23
  • 48
bunndan
  • 2,717
  • 3
  • 18
  • 20

17 Answers17

447

angular cli can report its version when you run it with the version flag

ng --version
Meir
  • 14,081
  • 4
  • 39
  • 47
  • 41
    If you want to check out the versions of your global npm modules, you could also type something like `npm list -global --depth 0` to your terminal. – fuma Jan 17 '17 at 12:36
  • @fuma's answer will work even if you don't have Angular CLI installed. But it is recommended. Install instructions: http://ngcli.github.io – Jacob Stamm Nov 09 '17 at 17:06
  • 2
    Downvoted since the OP specifically asks about the *global* installed package. @fuma's answer is correct – Inigo Feb 12 '18 at 18:58
  • 2
    I use CMD on windows 10. When I run `npm list -global --depth 0` it does NOT show angular. But When I execute `ng --version` it shows me the result of the answer https://stackoverflow.com/a/44555618/3209523 – canbax Oct 07 '19 at 06:02
  • 4
    If you try `ng --version` with angular cli 14, you will get _"Error: You need to specify a command before moving on. Use '--help' to view the available commands."_. Please use `ng version` instead. – Jaime Menendez Jun 08 '22 at 02:04
92

Execute:

ng v

or

ng --version

tell you the current angular cli version number

enter image description here

Legends
  • 21,202
  • 16
  • 97
  • 123
35

UPDATE: 22 Feb 2023:

You can use an NGVM for that

npm i ngvm -g
ngvm local - will print you the project ng version
ngvm global - will give you the global ng version
ngvm latest - will give you the global ng version

If you type ngvm --help you will find out how to get all thee versions (local/global/latest) with one single command


ng --version or short ng v kinda correct answers, but there are some important details:

If you running ng v inside your angular cli project folder it will show your local cli version installed in your project (package.json)

If you running ng v outside your angular cli project folder it will always show the global cli version

angularrocks.com
  • 26,767
  • 13
  • 87
  • 104
20

You can use npm list -global to list all the component versions currently installed on your system.
For viewing specific lists at different levels use --depth.

e.g:

npm list -global --depth 0
RobC
  • 22,977
  • 20
  • 73
  • 80
Himanshu
  • 835
  • 1
  • 13
  • 22
9

DON'T USE ng --version because it provides a global system installed angular version.

Go to the package.json file, and check the "@angular/core" version. It is an actual project version.

enter image description here

Sathiamoorthy
  • 8,831
  • 9
  • 65
  • 77
6

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

Y. Joy Ch. Singha
  • 3,056
  • 24
  • 26
5

Simply run the following command :

ng v

Mwiza
  • 7,780
  • 3
  • 46
  • 42
5

Simply just enter any of below in the command line,

ng --version OR ng v OR ng -v

The Output would be like,

Screenshot

Not only the Angular version but also the Node version is also mentioned there. I use Angular 6.

4

In Command line we can check our installed ng version.

ng -v OR ng --version OR ng version

This will give you like this :

 _                      _                 ____ _     ___

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

Angular CLI: 1.6.5
Node: 8.0.0
OS: linux x64
Angular: 
...
Vik2696
  • 347
  • 2
  • 7
  • 5
    why are there `...` after the angular. Shouldn't it show the version number – krv Apr 11 '18 at 12:30
  • Those `...` appears when you execute the command outside an angular application directory (global), if you execute the command within an angular application directory you will get the minimum angular version your angular application needs. – armadillo.mx Aug 15 '19 at 22:06
3

ng version or ng --version or ng v OR ng -v

You can use this 4 commands to check the which version of angular-cli installed in your machine.

Parth Raval
  • 4,097
  • 3
  • 23
  • 36
2

Simple run the following commands:

ng --version 

OR

 ng -v

Output on terminal:

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


Angular CLI: 6.0.8
Node: 10.15.0
OS: linux x64 
Salman Ahmed
  • 682
  • 1
  • 10
  • 24
2

Im using Angular CLI: 15.0.5 , no need double dash, just use command

ng version
abd aziz
  • 65
  • 5
1

You can find using CLI ng --version

As I am using

angular-cli: 1.0.0-beta.28.3

node: 6.10.1

os: darwin x64

enter image description here

Nitin .
  • 808
  • 9
  • 12
1

First try this : ng version

Else : ng --version

Mounesh
  • 561
  • 5
  • 18
0
ng --version

ng--version output

Please take a look at the above image.

jaleel
  • 1,169
  • 8
  • 22
  • 46
0

If you want to show version on your page, My version is Angular 12:

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

then :

export class AppComponent {
  title = 'version-twelve';
  version = VERSION.full;
}

HTML:

<span>{{version}}</span>
nano dev
  • 335
  • 4
  • 6
0

It works with ng version and it does not work with ng --version:

enter image description here

enter image description here

Second Person Shooter
  • 14,188
  • 21
  • 90
  • 165