How to check version of Angular?

I installed the package @angular/clithrough npm using this command:

npm install -g @angular/cli

Version 1.4.2 of @ angular / cli has been successfully installed. But this is not a version of Angular, but a version of the CLI.

After starting, ng new myapphow can I check the Angular version of the created application? 2.x, 4.x?

+77
source share
13 answers
ng version

You installed angular cli globally (-g in command). This means that you can type ng versionin your command line. It may be more accurate to do this when your command line is not in a directory controlled by npm (you must enter this in the directory you typed into ng new myapp).

, Google: ng version , () angular . angular 4.x(~ 4.3.0).

@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

.config, Angular: ....

+121

1 2 ( 4+):

, .

angular.version Javascript, .

Angular 4+ , :

/ VS Code. ( 3)

  1. --version ( )
  2. -v

, : enter image description here

  1. , . :

enter image description here

  1. package.json, .
+20

package.json . .

+13

.

ng -v OR ng --version OR ng version

:

 _                      _                 ____ _     ___

   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/

Angular CLI: 1.6.5
Node: 8.0.0
OS: linux x64
Angular: 
...
+10

ng v

.

+6

Angular CLI ng v , .

, grep :

ng v | grep 'Angular:'

:

Angular: #.#.# <-- VERSION

,

alias ngv='ng v | grep 'Angular:''

NGV

+2

.

@angular/cli: 1.2.6
node: 8.11.1
os: win32 x64
@angular/animations: 4.3.2
@angular/common: 4.3.2
@angular/compiler: 4.3.2
**@angular/core: 4.3.2**
@angular/forms: 4.3.2
+2

, , . , , , , - . ng -version, angular. ( ), CLI angular, , , , , , Vik2696.

$ cd my-project
$ ng --version   // done within project directory

Angular CLI: 1.6.8
Node: 8.9.4
OS: win32 x64
Angular: 5.2.5
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.8
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0
+1

7,

ng --version 
ng version
0

Angular/Cli . angular/cli, npm install -g @angular/cli

Angular7 enter image description here, Angular/Cli 1. ng --version, 2. ng version

0
  1. --v

- :

Angular CLI: 7.3.8
Node: 10.15.1
OS: win32 x64
Angular: 5.2.10
... animations, common, compiler, core, forms, http
... platform-browser, platform-browser-dynamic, router

4

0

ng -v ng --version.

0
-1

Source: https://habr.com/ru/post/1686078/


All Articles