How To Fix “ng is not Recognized as Internal or External Command, Operable Program or Batch File?”
Struggling with error then you are at the right place. We have covered the all possible solution for the error “ng is not Recognized as Internal or External Command, Operable Program or Batch File?”. Before jumping into the solution, let’s have a look into the possible reason for this error.
- If the angular command line tool is not installed on the system
- The ng Path variable is not added in Windows.
How To Fix “ng is not Recognized as Internal or External Command, Operable Program or Batch File?”
Solution for the first reason for the error:
If the angular command line tool is not installed on the system
Run the following command to Install the Angular CLI tool using the following command
> npm install -g @angular /cli
Now verify whether the error is fixed or not with the following command ng version
The ng Path variable is not added in Windows.
If you are unable to set the ng path in the Windows operating system then you might come across this error. Run the following command using ‘where’ to find out where the ng is installed or where the “ng.exe” file exists. Choose and copy the Path where ng is installed
> where ng
After figuring out the path you can launch the environment variable settings by going to the environment variables set. For your convience we are showing you the step by step guide.
- You can access it by searching it in the “Startup” menu to set ng path to the Windows path.
- Go to the “Environment Variables”. After that, select the “Path” property under “System variables” and then click the “Edit” button.
- Next, in the “Edit environment variables” window, click “New” put the copied path of ng installation location here, and then click the “Ok“ option.
Now, run the following command to see whether the error has been solved or not in your system. Most probably you will be out of the error issues in your system.
ng version