0
votes

when I'm running like "ng serve" or "ng g c abc" in terminal in visual studio it shows "The serve command requires to be run in an Angular project, but a project definition could not be found."

I tried the "ng update @angular/cli --from=1.7.4 --migrate-only" and it shows "Could not find a package.json. Are you in a Node project?"

1
cd into the ClientApp folder? - tony
As @tony commented, please cd i to the folder where the package.json file is present. - Koushik Ravulapelli

1 Answers

0
votes

When using Angular in Visual Studio, regardless of whether it's being hosted as part of Asp.Net or not, remember that Angular is a separate entity. 'ng serve' is an Angular command which has to be run in an Angular project

Hence make sure you run Angular commands in the ClientApp folder