@angular/cli package via npm, using this command:
npm install -g @angular/cli
The version 1.4.2 of @angular/cli has been successfully installed. But that is not the Angular version, but the CLI version.
ng new myapp how can I check which Angular version the created app is? 2.x, 4.x?
This question is tagged with
~ Asked on 2017-09-20 21:57:58
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 typed
ng 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.
@angular/cli: 1.2.1 node: 8.11.1 os: win32 x64 @angular/common: 4.3.0 @angular/compiler: 4.3.0 @angular/core: 4.3.0 @angular/forms: 4.3.0 @angular/http: 4.3.0 @angular/platform-browser: 4.3.0 @angular/platform-browser-dynamic: 4.3.0 @angular/router: 4.3.0 @angular/cli: 1.2.1 @angular/compiler-cli: 4.3.0
If you are not within a directory which has a packages.config, then you will get
~ Answered on 2017-09-20 22:20:25
You can also open the console and go to the element tab on the developer tools of whatever browser you use.
Write below code in the command prompt/or in the terminal in the VS Code. (up to 3)
- ng version or ng --version (Find the image for the reference)
- ng v
- ng -v
- You can also open the console and go to the element tab on the developer tools of whatever browser you use. As displayed in the below image :
- Find the package.json file, You will find all the installed dependencies and their version.
~ Answered on 2018-09-26 05:23:39