Programing

Angular 버전을 확인하는 방법은 무엇입니까?

lottogame 2020. 10. 14. 07:21
반응형

Angular 버전을 확인하는 방법은 무엇입니까?


@angular/cli다음 명령을 사용하여 npm을 통해 패키지를 설치했습니다 .

npm install -g @angular/cli

@ angular / cli 버전 1.4.2가 성공적으로 설치되었습니다. 그러나 그것은 Angular 버전이 아니라 CLI 버전입니다.

실행 후 ng new myapp생성 된 앱이 어떤 Angular 버전인지 어떻게 확인할 수 있습니까? 2.x, 4.x?


ng version

angular cli를 전역으로 설치했습니다 (명령에서 -g). 이것은 ng version명령 프롬프트에 입력 할 수 있음을 의미 합니다. 당신의 명령 프롬프트 때이 할 더 정확하게 할 수 없습니다 NPM 제어 디렉토리에 (당신이 해야 디렉토리에 사용자가 입력이 입력을 ng new myapp).

Google에서 여기에 온 사람들을위한 메모 : ng version 현재 디렉토리에서 참조하는 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

packages.config가있는 디렉토리에 있지 않은 경우 Angular: ....


Angular 1 또는 2의 경우 (Angular 4+에는 해당되지 않음) :

콘솔 을 열고 사용하는 브라우저의 개발자 도구에있는 요소 탭으로 이동할 수도 있습니다.

또는

각도 버전이있는 Javascript 객체에 액세스하려면 angular.version을 입력합니다.

Angular 4+의 경우 아래와 같은 방법이 있습니다.

명령 프롬프트 / 또는 VS 코드의 터미널에서 아래 코드를 작성하십시오. (최대 3 명)

  1. ng version 또는 ng --version (참조 용 이미지 찾기)
  2. ng v
  3. ng -v

터미널에서 첨부 된 이미지와 같이 각도 버전을 찾을 수 있습니다. 여기에 이미지 설명 입력

  1. 콘솔 을 열고 사용하는 브라우저의 개발자 도구에있는 요소 탭으로 이동할 수도 있습니다. 아래 이미지와 같이 :

여기에 이미지 설명 입력

  1. package.json 파일을 찾으면 설치된 모든 종속성과 해당 버전을 찾을 수 있습니다.

프로젝트에서 package.json 파일을 확인해야합니다. 설치된 모든 패키지와 해당 패키지의 버전이 표시됩니다.


명령 줄에서 설치된 ng 버전을 확인할 수 있습니다.

ng -v OR ng --version OR ng version

이것은 다음과 같이 줄 것입니다.

 _                      _                 ____ _     ___

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

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

ng v

터미널에서 위의 명령을 실행하기 만하면됩니다.


Angular CLI ng v는 버전보다 더 많은 것을 출력합니다.

버전 만 원하면 파이프 grep을 추가하고 다음과 같이 각도를 필터링 할 수 있습니다.

ng v | grep 'Angular:'

산출:

Angular: #.#.# <-- VERSION

이를 위해 별칭이 있습니다.

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

그런 다음 ngv를 사용 하십시오.


ng 버전 실행

then simply check the version of angular core package.

@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

I think the answer given by D. Squire was accurate, but possibly only a tad vague. If you change directories to a project and then type ng --version, it will display the angular version in the project. If done from a default directory (not within a project), you will only get the Angular CLI version, which is probably not what you are looking for and will give the output shown by 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

From angular 7 on-wards the following two commands are working

ng --version 
ng version

First install the Angular/cli globally in machine. to install the angular/cli run the command npm install -g @angular/cli

Above Angular7 , use these two commands 여기에 이미지 설명 입력to know the version of Angular/Cli 1. ng --version, 2.ng version


  1. ng v
  2. ng --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

Angular 버전은 위의 4 행에 있습니다.


터미널에서 ng -v또는 ng --version.


ng --version

이 vidio를 시청하여 최신 앵귤러 버전을 설치할 수 있습니다. https://youtu.be/zqHqMAWqpD8

참고 URL : https://stackoverflow.com/questions/46332383/how-to-check-the-angular-version

반응형