How to know the version of Angular installed by Angular CLI?

Asked

Viewed 31,875 times

6

I wonder how I can find out the version of Angular I’m using?

3 answers

11


No command line

You can search for the version of @angular/common or another Angular dependency on 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",
}

Command-line

On 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 exit must 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 in my design 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 return only the CLI version.

-2

In fact, the command to be executed is: ng --version

-4

For me the command ng --version worked

  • 1

    Really? Wasn’t that already written in the other answers? See ng version. Do our [tour]

  • Augusto Vasques, I just signaled that for me the ng -- version command worked, because Marcell Alves' answer was -1 and I didn’t understand why. That was my first post on this forum and I’ve seen that here it’s quite difficult. Get minus -4 so, come on.

  • If you look at Stack Overflow as a forum, it’s going to be tough. Stack Overflow is not a forum or social network, we are a site of questions and answers and our goal is precisely to remove the discussion or interaction between publishers, because this only causes endless noises and debates, transferring this interaction to the voting system. Take a look [Answer] and take our [tour].

  • PS : Marcelo Alves was the one who edited and improved the response, the author was Dom Braga. PS :At the time of writing the question of Dom Braga has 3 negative votes and 1 positive vote, vote summary of the issue.PS : In general the reader of the site does not want to see two equal answers or that presents the same information. Our reader wants to find in each answer an alternative solution.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.