为什么我无法在工作区内运行NG服务?

发布于 2025-02-08 20:54:24 字数 119 浏览 2 评论 0原文

因此,基本上,如果我在终端内部和右工作区内键入命令“ 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

拒绝两难 2025-02-15 20:54:24

在您的项目中找到Angular.json文件。在中运行ng服务 文件夹。

Find the angular.json file in your project. Run ng serve in that folder.

睫毛上残留的泪 2025-02-15 20:54:24

当我在终端中键入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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文