ERROR: The serve command requires to be run in an Angular project, but a project definition could not be found

ERROR: The serve command requires to be run in an Angular project, but a project definition could not be found

我从网上下载了一个项目并尝试了ng serve但是我得到了:

The serve command requires to be run in an Angular project, but a project definition could not be found.

所以我尝试了这个命令(因为在 README 文件中写了生成应用程序的 CLI 版本是 1.4.9):

ng update @angular/cli --migrate-only --from=1.4.9

执行此命令后我没有收到任何错误,但是当我尝试 ng serve 时,我再次收到之前的错误! 我该如何解决这个问题?

更新后,您是否 cd 回到了 angular 项目中带有 src > app 的项目?你必须在 package.json 存在的目录中 运行 这个命令