ng 未被识别为内部或外部命令 [英] ng is not recognized as an internal or external command

查看:36
本文介绍了ng 未被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

运行 windows 7 Professional 32 位.

Running windows 7 Professional 32bit.

我尝试在普通或管理员下运行 npm install -g angular-cli.

I tried running npm install -g angular-cli both under normal or admin.

我也尝试将它添加到 PATH: (C:UsersAdministratorAppDataRoaming pm ode_modulesangular-cliin g) 下的环境变量中,但没有成功也.

I also tried adding it to the Enviorment Variables under PATH: (C:UsersAdministratorAppDataRoaming pm ode_modulesangular-cliin g) , with no success also.

我做错了什么?

推荐答案

我按照图解决了这个问题:

I solved this problem in accordance with the figure:

在 cmd 中运行

 npm install -g @angular/cli

然后

(在 Windows 10 中打开)控制面板所有控制面板项系统还是按照图来的

( open in Windows 10) Control PanelAll Control Panel ItemsSystem or accordance with the figure

第 1 步:

第 2 步:

第三步:

第四步:

第五步:添加缺失的 ng 路径

这是您需要添加的新环境变量:C:UsersPKAppDataRoaming pm ode_modules@angularcliin

Here is new environment variable that you need add: C:UsersPKAppDataRoaming pm ode_modules@angularcliin

最后,重新启动所有打开的命令提示符,然后重试.

这篇关于ng 未被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆