angularjs - 我已经安装了 angular cli 但它在 cmd 中无法识别

标签 angularjs node.js windows git npm

实际上我已经正确安装了 Nodejs,然后是 npm,然后是 angular cli (afaik)。但是在 Windows cmd 和 git bash 中,它显示“ng --version”为:

ng is not recognized as an internal or external command, operable program or batch file.

从 Windows 命令提示符

from windows command prompt

来自 github bash

from github bash

但是当我在 Node 命令提示符下尝试这个命令时,它显示了 ng 版本。

from nodejs cli

因此,我无法使用 ng serve。我也尝试安装 bower 和 gulp。两者都出现相同的“未识别”错误。帮助解决这个问题。

感谢和问候, 沙夫丁

最佳答案

首先请确保您的机器上安装了 Node.js

如果您已经在您的机器上安装了 Node.js,您可以使用 Node.js 命令提示符而不是 Windows 命令提示符

enter image description here

然后尝试命令 npm ng --version

enter image description here

在 Windows 提示符下转到您的项目本地目录(使用命令 cd projectdirectorypath),然后使用相同的命令 npm ng --version

关于angularjs - 我已经安装了 angular cli 但它在 cmd 中无法识别,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45254127/

相关文章:

html - 如何以特定方式使 div 内联?

javascript - angularjs选择框默认选择基于数据库id

AngularJs 单元测试 - 检查 "Init"函数是否被调用

angularjs - IBM推送: cannot use sendNotificationByDeviceIds in ibmpush. js

javascript - 如何将链接传递给express.js中的req.flash()

node.js - 使用 mongoose 和 express 处理数据验证的最佳场所

mysql - 如何修复 node.js 代码以检查登录

java - Sencha Cmd 5 + Java 8 错误

windows - 从 Windows Powershell 脚本上传到 Artifactory

c# - Windows 7 操作系统中的服务不使用主机文件作为本地服务