I'm fairly new to Angular. But when I try to start my project with ng serve --open, I get this
error.
My project structure is like this. What can be the problem?
I'm fairly new to Angular. But when I try to start my project with ng serve --open, I get this
error.
My project structure is like this. What can be the problem?
You just need to be sure that you are at the root directory of the application, also check the angular.json if it has any structure issue
Navigate to root folder in terminal and then run angular cli command. Below command will put you in root directory from current location => cd angular_t-project
To Fix Error “This command is not available when running the Angular CLI outside a workspace Error”, Do Right-Click on yours project name in VS Code and Click “Open in Integrated Terminal” Option.
It would open the project to your terminal and error would be fixed. Now you would be able to run the command “ng serve –open” or "ng serve" into your terminal without any issue.
Hope it helps :)
As everyone else has said, you have to be in the root folder.
If you using Visual Studio 2019/2022, use the Terminal/PowerShell:
cd C:\Users\<user>\source\repos\<solution>\<projectname>\ClientApp