How To Fix “ng is not Recognized as Internal or External Command, Operable Program or Batch File?”

How To Fix “ng is not Recognized as Internal or External Command, Operable Program or Batch File?”

Fix “ng is not Recognized as Internal or External Command, Operable Program or Batch File?”

You might come across this error while using the ng directive on Command Prompt. There basically two reasons for the error “ng is not Recognized as Internal or External Command”. It may occur:

  • 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?”

Let’s start with the first solution.

Install Angular Command Line Tool

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

Another Solution:

The error “ng is not Recognized as an Internal or an External Command” may occur if the ng path is not set in the Windows operating system. 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

Now, Launch environment variable settings by going to the environment variables set. 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.

READ More Relevant Stuff:  5 Ways To Count The Number Of Lines In A File In Linux

Now, run the following command to see whether the error has been solved or not.

ng version

 

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply

    Your email address will not be published. Required fields are marked *