How to know the Angular version installed by Angular CLI?

2

I would like to know how can I find out which version of Angular I'm using?

    
asked by anonymous 23.11.2017 / 15:59

1 answer

4

No command line

You can search for the version of @angular/common or another dependency of the Angular in the package.json file in dependencies :

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

With command line

At the command line, navigate to the root directory of your Angular project and run ng -v or ng version :

cd meu/projeto/
ng -v

The output should be something like:

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _' | | | | |/ _' | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.4.3
node: 8.4.0
os: darwin x64
@angular/animations: 4.4.6
@angular/common: 4.4.6
@angular/compiler: 4.4.6
@angular/core: 4.4.6
@angular/forms: 4.4.6
@angular/http: 4.4.6
@angular/platform-browser: 4.4.6
@angular/platform-browser-dynamic: 4.4.6
@angular/router: 4.4.6
@angular/cli: 1.4.3
@angular/compiler-cli: 4.4.6
@angular/language-service: 4.4.6
typescript: 2.3.4

You can see that in my project the Angular version is 4.4.6.

Be careful not to confuse the version of @angular/cli with the version of Angular used in your project. If you run ng version or ng -v in a directory that does not have an Angular project, it will only return the CLI version.

    
23.11.2017 / 16:16