无法将"ng"识别为内部或外部命令,可操作程序或批处理文件 [英] 'ng' is not recognized as an internal or external command, operable program or batch file

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

问题描述

我尝试运行npm install -g angular-cli

I tried running npm install -g angular-cli

我还尝试将其添加到PATH下的环境变量中:(C:\ Users \ Administrator \ AppData \ Roaming \ npm \ node_modules \ angular-cli \ bin \ ng),也没有成功.

I also tried adding it to the Enviorment Variables under PATH: (C:\Users\Administrator\AppData\Roaming\npm\node_modules\angular-cli\bin\ng) , with no success also.

推荐答案

此错误只是告诉您未安装Angular CLI或未将Angular CLI添加到PATH.要解决此错误,首先,请确保您正在运行Node 6.9或更高版本.只需将Node升级到最新的稳定版本,即可解决很多错误.

This error is simply telling you that Angular CLI is either not installed or not added to the PATH. To solve this error, first, make sure you’re running Node 6.9 or higher. A lot of errors can be resolved by simply upgrading your Node to the latest stable version.

在macOS/Linux上打开终端或在Windows上打开命令提示符,然后运行以下命令以查找正在运行的Node的版本:

Open up the Terminal on macOS/Linux or Command Prompt on Windows and run the following command to find out the version of Node you are running:

这篇关于无法将"ng"识别为内部或外部命令,可操作程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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