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
Checking version of angular-cli that's installed?
提问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 -v和node -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
回答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 v在angular cli项目文件夹中运行,它将显示您的项目中安装的本地 cli 版本 (package.json)如果您
ng v在angular 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
回答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 .
回答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


