-m is not recognized as an internal or external command, operable program or batch file.

The Angular JS structural framework provides new directives (classes that control and manipulate elements) for HTML. HTML is extended by AngularJS directives are attributes with the prefix ng-. Angular provides ng-app used for angular applications, ng-model is used for Angular app views such as text fields, and ng-init is used to initialize data and variables.

Sometimes during using the ng directive on Command Prompt, we encounter 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, or the ng Path variable is not added in Windows.

In this blog, we will compile the following solutions to resolve the specified issue.

  • By Installing Angular Client
  • By Adding Path to Windows

So, let us get started!

Prerequisites: Install NPM

Npm is a well-known package manager that supports JavaScript applications. NPM will be set up right away after Node.js is installed on Windows. Here is the URL for the article explaining how to use NPM to install Node.js:

To discover how to install NPM on Windows, visit the “How to install Nodejs on Windows” page.

Solution 1: Install Angular Command Line Tool

The command line tool that is primarily used to create and maintain initialized Angular applications is known as the Angular/CLI tool. The specified error may occur if the Angular command line tool is not installed on the system.

As you can see, when we try to check ng which is a prefix of Angular it shows an error.

-m is not recognized as an internal or external command, operable program or batch file.

We can resolve the “ng is not Recognized as Internal or External Command” error by installing “Angular/cli” on Windows which can be easily installed using the NPM package manager. To fix the specified error, follow up on the listed procedure.

Step 1: Open Command Prompt

First, open the Windows Command Prompt by searching it in the Start menu:

-m is not recognized as an internal or external command, operable program or batch file.

Step 2: Install Angular CLI Tool

Utilize NPM which contains thousands of packages to install the Angular command line tool. For this purpose, execute the mentioned command:

> npm install -g @angular/cli

-m is not recognized as an internal or external command, operable program or batch file.

Step 3: Verify if the Problem is Resolved or Not

Let’s verify whether the error is fixed or not. To do so check the ng version on Windows:

-m is not recognized as an internal or external command, operable program or batch file.

Solution 2: Add Path of ng to Windows

The error “ng is not Recognized as an Internal or an External Command” may occur if the ng path is not set in Windows. Before accessing ng from the Windows command line, ng must first be added to the Windows path. In order to accomplish this and to resolve the found error, use the following instructions.

Step 1: Find ng Installation Location

To find out where the ng is installed or where the “ng.exe” file exists, utilize the “where” command as shown below:

After determining the location of the ng installation, choose and copy the Path where ng is installed:

-m is not recognized as an internal or external command, operable program or batch file.

Step 2: Launch Environment Variable Settings

Open the environment variables setting by searching it in the “Startup” menu to set ng path to Windows path:

-m is not recognized as an internal or external command, operable program or batch file.

Hit “Environment Variables” button from the Advance Setting panel:

-m is not recognized as an internal or external command, operable program or batch file.

Step 3: Set ng Path to System Variable

After that, select the “Path” property under “System variables” and then click the “Edit” button:

-m is not recognized as an internal or external command, operable program or batch file.

Next, in the “Edit environment variables” window, click “New” and put the copied path of ng installation location here, and then click “Ok“:

-m is not recognized as an internal or external command, operable program or batch file.

Step 4: Verify if the Error is Resolved or Not

Let’s check if the error has been resolved or not. To do this, again check the ng version here:

You can see that we have successfully fixed the specified error on Windows:

-m is not recognized as an internal or external command, operable program or batch file.

We have provided feasible solutions to fix the “ng is not recognized as an internal or an external command” error.

Conclusion

You could run into the problem “ng is not Recognized as an Internal or an External Command” for a variety of reasons. It’s possible that the ng installation path was not added to the Path environment variable or that the angular command line tool was not installed. The first solution is to install angular/cli using NPM and the other is adding the ng path to Windows advance settings. In this blog, we have compiled feasible solutions to resolve the specified error on Windows.

About the author

-m is not recognized as an internal or external command, operable program or batch file.

I am graduated in computer science. I am a junior technical author here and passionate about Programming and learning new technologies. I have worked in JAVA, HTML 5, CSS3, Bootstrap, and PHP.

How do you fix make is not recognized as an internal or external command operable program or batch file?

You can resolve this issue in three ways: First, use the full path of the executable file to launch the program. Second, add the program path to Windows environment variables. Finally, move the files to the System32 folder.

What is not recognized as an internal or external command operable?

The “is not recognized as an internal command” error usually occurs because the computer can't find the executable that you're asking it to launch. However, you can provide it with the full path to your executable file and it should then be able to run it without any issues. Launch a Command Prompt window on your PC.

Is not recognized as an internal or external command operable program or batch file error in Python?

The “Python is not recognized as an internal or external command” error is encountered in the command prompt of Windows. The error is caused when Python's executable file is not found in an environment variable as a result of the Python command in the Windows command prompt.