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

angularangular-clinpmnpm-audit

I have cloned one of my old project from github and tried to install node_module and found some vulnerabilities. To fix them I ran the following command

npm audit fix

there were still some more vulnerabilities, so I ran the forced fix command

npm audit fix --force

After that when I am trying to run the project I am getting this –

Error

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

Best Answer

the reason is that the new @angular/cli form version 7, have an angular.json file instead of angular-cli.json in version 1.x.x you can fix that by running:

ng update @angular/cli --migrate-only --from=<Your_Angular_CLI_Old_Version>

it will replace angular-cli.json file by the new file