6

I tried to check the angular version of the project I'm working on by doing ng version but the value I'm getting are the ff:

Angular CLI: 8.2.1
Node: 10.16.0
OS: win32 x64
Angular: undefined

how do I know what version of my angular?

Amulya K Murthy
  • 130
  • 1
  • 2
  • 15
JC Borlagdan
  • 3,318
  • 5
  • 28
  • 51
  • 2
    The CLI is for Angular but you seem to be using AngularJS. – str Aug 14 '19 at 09:17
  • @str yeah it seems to be the case, is there any issues with that in the project? or is there other ways for me to know the Angular version when the CLI is angular? – JC Borlagdan Aug 14 '19 at 09:45
  • I highly doubt that you can use the CLI with AngularJS at all. – str Aug 14 '19 at 09:50
  • Possible duplicate of [How can I check which version of Angular I'm using?](https://stackoverflow.com/questions/16017699/how-can-i-check-which-version-of-angular-im-using) – str Aug 14 '19 at 09:50
  • 4
    this isn't duplicate since I checked that link before I created this question. and the answers there are just way of getting the version not the answer to "why" is it undefined. but thanks – JC Borlagdan Aug 15 '19 at 01:11

2 Answers2

5

This is because as of Angular 7, the version of Angular core and Angular CLI need to be aligned, so their versions are likely to be the same. As your version is above 7, there is no explicit need to mention Angular Version seeing that Angular CLI version is already mentioned. Source: https://angular.io/guide/releases

phuzi
  • 12,078
  • 3
  • 26
  • 50
Adhi Sekar
  • 77
  • 4
2

It sounds like you are running this command outside the Angular project folder where there is no package.json or angular.json

https://github.com/angular/angular-cli/issues/17683

Omar Hasan
  • 719
  • 7
  • 18