node.js 检查已安装的 angular-cli 版本?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/41026895/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 17:51:52  来源:igfitidea点击:

Checking version of angular-cli that's installed?

node.jsangularnpmangular-cli

提问by bunndan

Is there a way to check the specific version of angular-cli that's installed globally on my machine? I'm in a Windows environment. npm -vand node -vonly gives me the version of npm and node respectively, and I can't seem to find any commands with ng.

有没有办法检查我的机器上全局安装的 angular-cli 的特定版本?我在 Windows 环境中。 npm -vnode -v 分别只给我 npm 和 node 的版本,我似乎找不到任何带有ng 的命令。

I'm trying to run a project that I'm working on, and it ran on an older version of angular-cli using npm. However, after installing other demo projects, my main project doesn't work anymore without uninstalling and reinstalling angular-cli at the specific version.

我正在尝试运行一个我正在处理的项目,它使用 npm 在旧版本的 angular-cli 上运行。但是,安装其他演示项目后,如果不卸载并重新安装特定版本的 angular-cli,我的主项目将不再工作。

回答by Meir

angular cli can report its version when you run it with the version flag

当您使用版本标志运行时,angular cli 可以报告其版本

ng --version

回答by Legends

Execute:

执行:

ng v

or

或者

ng --version

tell you the current angular cli version number

告诉你当前的 angular cli 版本号

enter image description here

在此处输入图片说明

回答by kuncevic.dev

ng --versionor short ng vkinda correct answers, but there are some important details:

ng --version或简短的ng v正确答案,但有一些重要的细节

If you running ng vinsideyour angular cli project folderit will show your local cli version installed in your project (package.json)

If you running ng voutsideyour angular cli project folderit will always show the global cli version

如果您ng vangular cli项目文件夹中运行,它将显示您的项目中安装的本地 cli 版本 (package.json)

如果您ng vangular cli项目文件夹之外运行 ,它将始终显示全局 cli 版本

回答by Himanshu

You can use npm list -globalto list all the component versions currently installed on your system.
For viewing specific lists at different levels use --depth.

e.g:

您可以使用npm list -global列出系统上当前安装的所有组件版本。
要查看不同级别的特定列表,请使用--depth.

例如:

npm list -global --depth 0

回答by Y. Joy Ch. Singha

Go to your folder path in cmd where your angular is installed and type ng --versionit will show your angular version. Thanks.

转到 cmd 中安装 angular 的文件夹路径,然后键入 ng --version它将显示您的 angular 版本。谢谢。

回答by Pramod Dissanayake

Simply just enter any of below in the command line,

只需在命令行中输入以下任何一项,

ng --versionORng vORng -v

ng --versionng vng -v

The Output would be like,

输出会像,

Screenshot

截屏

Not only the Angular version but also the Node version is also mentioned there. I use Angular 6.

那里不仅提到了 Angular 版本,还提到了 Node 版本。我使用 Angular 6。

回答by Mwiza

Simply run the following command :

只需运行以下命令:

ng v

ng v

回答by Vik2696

In Command line we can check our installed ng version.

在命令行中,我们可以检查我们安装的 ng 版本。

ng -v OR ng --version OR ng version

This will give you like this :

这会给你这样的:

 _                      _                 ____ _     ___

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

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

回答by Nitin .

You can find using CLI ng --version

您可以使用 CLI 找到 ng --version

As I am using

当我使用

angular-cli: 1.0.0-beta.28.3

角度cli:1.0.0-beta.28.3

node: 6.10.1

节点:6.10.1

os: darwin x64

操作系统:达尔文 x64

enter image description here

在此处输入图片说明

回答by Salman Ahmed

Simple run the following commands:

简单运行以下命令:

ng --version 

OR

或者

 ng -v

Output on terminal:

终端输出:

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


Angular CLI: 6.0.8
Node: 10.15.0
OS: linux x64