[Solved] Error: This command is not available when running the Angular CLI outside a workspace

Angular Mohit Mozumder

Problem:

In my Angular project I am trying to run ng serve --open command in my terminal but I am facing the following error:

Error: This command is not available when running the Angular
CLI outside a workspace


Solution:

To fix this error follow the steps below-

1. First goto VScode & Right-Click on your project name and Click Open in Integrated Terminal Option.

2. 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.

Note: You just need to be sure that you are at the root directory of the application.


Thank you for reading the article. For any other help feel free to contact with us.