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

查看:28
本文介绍了Angular's - 'ng'不是内部或外部命令、可运行的程序或批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

C:\Angula2\myapp>ng serve --open'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>node -vv8.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's - 'ng'不是内部或外部命令、可运行的程序或批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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