I installed the @angular/cli
package via npm using:
npm install -g @angular/cli
The version 1.4.2 of @angular/cli
has been successfully installed. That is not the Angular version, but the CLI version.
After running ng new myapp
how can I check which Angular version the created app is using? 2.x, 4.x?
Best Answer
You installed angular cli globally (-g in the command). This means that you can type
ng version
into your command prompt. It may be more precise to do this when your command prompt is not within a npm controlled directory (you should type this in within directory you typedng new myapp
).A note to those who got here from Google:
ng version
will let you know which (coarse) version of Angular is referenced by the current directory. e.g. This directory appears to have angular 4.x (~4.3.0) installed.If you are not within a directory which has a packages.config, then you will get
Angular: ...
.