When running the terminal commands ng server
or ng serve --live-reload=true
, I'm getting this issue:
The serve command requires to be run in an Angular project, but a project definition could not be found.
When running the terminal commands ng server
or ng serve --live-reload=true
, I'm getting this issue:
The serve command requires to be run in an Angular project, but a project definition could not be found.
In my case, I forgot to change my directory, so just after running the command :
execute another command :
and
ng serve
worked for me.I had the same issue with Angular7 because we need to go the root folder before run your application. Go to the root folder of your app and run the command. It works perfectly for me.
I would suggest to confirm if you are in the directory of the project.
This error may be occur when we are in wrong directory.so use cd command to change your directory. It's not very evident from the above comment that which specific command is giving this error so this answer is based on assumption that you are running ng serve outside the root folder/actual project folder. That's why it's giving error because cli commands require conf & build files to run the cli build.
Tried all the above But for me it was solved by
npm start
This happens when you try to run the Angular command "ng s" or "ng serve" on the other folder instead of the root folder of the Angular application.
Also upgrade the Angular using the following command:
This will sort it out.