Angular的-'ng'不被识别为内部或外部命令,可操作程序或批处理文件 [英] Angular's - 'ng' is not recognized as an internal or external command, operable program or batch file
问题描述
C:\ Angula2 \ myapp> ng服务-打开 无法将"ng"识别为内部或外部命令, 可操作的程序或批处理文件.
C:\Angula2\myapp>ng serve --open 'ng' is not recognized as an internal or external command, operable program or batch file.
当前我的系统中也有节点
and currently i am having node also in my system
C:\ Angula2 \ myapp>节点-v v8.10.0
C:\Angula2\myapp>node -v v8.10.0
以及如何在没有管理员权限的情况下运行Angular4.
And How to run Angular4 with out having Admin permissions.
推荐答案
您必须全局安装angular-cli
才能使用ng
you have to install angular-cli
globally to use ng
npm i -g @angular/cli
在不进行全局安装的情况下使用angular-cli.
to use angular-cli without global installation.
将ng serve --open
添加到package.json中的脚本部分.
Add ng serve --open
to the scripts section in your package.json.
scripts:{
"start": ng serve --open
}
然后在项目目录中运行npm start
.
then run npm start
in your project directory.
这篇关于Angular的-'ng'不被识别为内部或外部命令,可操作程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!