0

I am trying to run an angular project using ng serve practice-app but am getting this error when using that command: The serve command requires to be run in an Angular project, but a project definition could not be found. I am able to run other Angular projects with ng serve but I cannot this one started. The red folders is obviously concerning, but being new to angular I'm not quite sure what's going on there.

I am using Angular CLI 11.1.1 and Node 12.4.0. I've tried variations of uninstalling and reinstalling angular, cleaning cache, and pretty much everything mentioned in other posts, but so far no luck so I am posting this as a last resort. Anyone know how to fix?

enter image description here

Noah Iarrobino
  • 1,435
  • 1
  • 10
  • 31
  • Does your folder have an `angular.json` file? – Edric Jan 26 '21 at 03:14
  • it has a an ```angular-cli.json``` file, I'm not sure if that's the same thing or not – Noah Iarrobino Jan 26 '21 at 03:25
  • Does this answer your question? [Angular CLI Error: The serve command requires to be run in an Angular project, but a project definition could not be found](https://stackoverflow.com/questions/53096996/angular-cli-error-the-serve-command-requires-to-be-run-in-an-angular-project-b) – Frank Fajardo Jan 26 '21 at 04:34
  • unfortunately no, top answer gave me this error: ```Repository is not clean. Please commit or stash any changes before updating.``` even after forcing – Noah Iarrobino Jan 26 '21 at 05:02

1 Answers1

0

It happened to me that I was trying to run the ng serve command in a project created with Ruby on Rails. In other words, it had to run the rails -s command for Ruby on Rails. I got confused because Angular was integrated into Ruby on Rails, so I had to run the rails -s command to start my project's local server.

Nube Colectiva
  • 147
  • 2
  • 7