【问题标题】:Angular: The serve command requires to be run in an Angular project, but a project definition could not be foundAngular:serve 命令需要在 Angular 项目中运行,但找不到项目定义
【发布时间】:2021-01-26 03:13:18
【问题描述】:

我正在尝试使用 ng serve practice-app 运行一个 Angular 项目,但在使用该命令时出现此错误:The serve command requires to be run in an Angular project, but a project definition could not be found. 我可以使用 ng serve 运行其他 Angular 项目,但我无法启动这个项目。红色文件夹显然是令人担忧的,但是对于 angular 的新手,我不太确定那里发生了什么。

我正在使用 Angular CLI 11.1.1 和 Node 12.4.0。我已经尝试了卸载和重新安装 Angular、清理缓存以及其他帖子中提到的几乎所有内容的变体,但到目前为止还没有运气,所以我将其发布为最后的手段。有人知道怎么解决吗?

【问题讨论】:

标签: angular


【解决方案1】:

我碰巧尝试在使用 Ruby on Rails 创建的项目中运行 ng serve 命令。换句话说,它必须为 Ruby on Rails 运行 rails -s 命令。 我很困惑,因为 Angular 被集成到 Ruby on Rails 中,所以我不得不运行 rails -s 命令来启动我项目的本地服务器。

【讨论】:

    猜你喜欢
    • 2020-08-25
    • 1970-01-01
    • 1970-01-01
    • 2019-04-05
    • 2021-04-13
    • 2020-04-19
    • 1970-01-01
    • 2020-03-19
    • 2023-03-13
    相关资源
    最近更新 更多