close

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

To solve Error: This command is not available when running the Angular CLI outside a workspace you need to open the Integrated Terminal from the root of your project and then run the ng serve command from there and your error will be solved.

Solution 1: Open Your terminal with your workspace

Here in this Case You might not use your workspace terminal and that’s why you are facing this error. But You just need to Open Your terminal with your workspace. Just follow the below step and your error will be solved.

First of all Right-click on your Project Name in VS Code left sidebar. And You’ll See Something like the below Interphase.

And Then Click on Open in Integrated Terminal and then You can run ng serve command without any issue. Hopefully, Your error might be solved now, thanks.

Solution 2: Check angular.json

Just make Sure Your angular.json file has no structure error. If is there any problem in your angular.json then fixing it will resolve your error.

Conclusion

You need to run the ng serve command from the root of your project and your error will be solved. Hope our article helped you to solve this error also comment below which solution worked for you. Thanks.

Also, Read

8 thoughts on “[Solved] Error: This command is not available when running the Angular CLI outside a workspace”

Leave a Comment