为什么我无法在工作区内运行NG服务?
因此,基本上,如果我在终端内部和右工作区内键入命令“ ng服务”。 (我还尝试了“ sudo ng serve”)由于某种原因,我会出现以下错误:错误:在工作区外运行角CLI时,此命令不可用。
有人可以帮我吗?
So basically if I type the command "ng serve" inside the terminal and inside the right workspace. (I also tried "sudo ng serve") I get the following error for some reason : Error: This command is not available when running the Angular CLI outside a workspace.
Can someone help me please?!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的项目中找到Angular.json文件。在中运行
ng服务
文件夹。Find the angular.json file in your project. Run
ng serve
in that folder.当我在终端中键入
ng new ProjectName
以启动一个新项目时,我遇到了这个错误,并且仅通过删除旧项目的所有目录和文件来解决它。在那之后运行正常。PS:我的错误是“在工作区内运行角CLI时,该命令不可用。”不在工作区外。
i got this error when i typed
ng new projectName
in the terminal to start a new project and i solve it just by deleting all the directories and files of the old project. It works fine after that.PS: my error was "This command is not available when running the Angular CLI inside a workspace." not outside a workspace.