1

I know that this question already was on Stackoverflow, and I'm sorry for it, but I didn't get my right answer, so this is a situation: I try to run my project and I get this error --

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

  1. Project was cloned from git and it is of elder vervion of Angular5.
  2. I tried to -npm install , -npm update, -ng i @angular/cli.
  3. Tried to unistall and clean cache.
  4. I -ng serve it in the right directory

So what I can do more to solve this issue???

2
  • 1
    Are you trying to run ng serve and npm install commands from the project directory folder? Commented Nov 23, 2019 at 13:47
  • Yes, sure as I wrote in question Commented Nov 25, 2019 at 13:04

1 Answer 1

0

Try these,

  1. If you are running any commands like npm install or ng serve, always ensure that you are running them from the project‘s root directory. Eg: where your package.json & angular.json files are located.

  2. If you find a file named angular-cli.json instead of angular.json, you need to run this command,

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

    For example if your older Angular CLI version is 1.0.0,

    ng update @angular/cli --migrate-only --from=1.0.0
    
  3. If the above fixes didn’t help, Try this command,

    ng update --all --force
    
0

Not the answer you're looking for? Browse other questions tagged or ask your own question.