角度-ng:找不到命令 [英] Angular - ng: command not found
问题描述
我正在尝试学习Angular,而我在终端机上的知识是新手.在我安装了Angular之后,然后键入ng new my-project
.我得到响应ng: command not found
.我看过其他有此问题的帖子,并且已经卸载并重新安装了 npm 和 ng .
I am trying to learn Angular and my knowledge in terminal is beginner. After I installed Angular and then type ng new my-project
. I get the response ng: command not found
. I've seen other posts that had this problem and I've uninstalled and reinstalled npm and ng.
我最后一步是npm install -g @ angular/cli @ latest然后ng new my-project.
The last step I took was npm install -g @angular/cli@latest then ng new my-project.
然后我得到ng: command not found
.
推荐答案
猜猜您正在 Windows 上运行 (使 @jowey的答案 r更简单).
Guess You are running on Windows (To make @jowey's answer more straightforward).
- 通常通过 bash
$ npm install -g @angular/cli@latest
安装Angular 接下来是重新设置路径 - NPM
- Nodejs
- Angular CLI
- Install Angular normally from your bash
$ npm install -g @angular/cli@latest
Next is to rearrange the PATHS to - NPM
- Nodejs
- Angular CLI
在系统环境变量"中,下图显示了排列方式.
in System Environment Variables, the picture below shows the arrangement.
这篇关于角度-ng:找不到命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!