'ng' 不是内部或外部命令,也不是可运行的程序或批处理文件 [英] 'ng' is not recognized as an internal or external command, operable program or batch file

查看:32
本文介绍了'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 未安装或未添加到 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 上打开命令提示符并运行以下命令以找出版本您正在运行的节点:

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:

node --version

这篇关于'ng' 不是内部或外部命令,也不是可运行的程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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