Alternative
Amazon
Article
Writing
Art
AI
Angular
Photoshop
Premiere
Animal Crossing
Blog
Story
Android
Android Studio
Davinci Resolve
CSS
Clipchamp
ChatGPT
Crypto
DALL-E
Discord
Davinci Resolve
Davinci Resolve 18
Dream Studio
Express
Filmora
Flutter
PC Games
Git
GPT
GPT3
GPT4
GTA
GTA 6
Ghost Together
Ghost Together
HTML
iOS
iMovie
Illustrator
JavaScript
Mac
Mongo
Midjourney
Minecraft
Node.js
NBA 2k24
OSX
PHP
Palworld
Python
Playground AI
Roblox
React
Recipe (Cooking)
React Native
Semicolon.dev
Starfield PC Game
Snapchat
Steam
Stable Diffusion
SVG
Threads
Text To Image (AI)
VSCode
Vim
Web Development
Windows
WebGL
Angular Tutorials

    How To Fix Angular's ng Is Not Recognized As An Internal Or External Command

    You will get this error for two main reasons. One, is the Angular's ng command is not installed on your system at all. And second, ng command is installed, but its installation path wasn't added to Environment Variables on your Windows system. This means ng command will not be able to execute, if on your command prompt, you have not navigated to Angular's installation folder first. However, in most cases you will want to call ng from anywhere in your Terminal or Command Prompt. If you want to run ng from any location on your hard drive in the Window's command prompt, you have to add ng's folder location to Path variable in Windows 10 or 11. And just make sure that ng is actually installed.

    You might have trouble figuring out Angular's default installation directory.

    This is because Angular is a JavaScript framework, and it isn't installed to a specific directory like traditional software. Instead, it's usually installed globally or locally within a project via Node.js's package manager (npm) or Yarn.

    Below are some common directories where Angular and its tools might be located on your computer:

    Global Angular CLI installation with npm on Windows:

    C:\Users\username\AppData\Roaming\npm\node_modules\@angular\cli\bin

    Global Angular CLI installation with yarn on Unix-based systems:

    /Users/username/.config/yarn/global/node_modules/@angular/cli/bin

    Now, one step at a time...

    When typing a command like ng into command prompt, Windows will look for that command first in the current directory. Current directory is displayed on the left hand side, such as C:\my_project\ for example.

    If it doesn't find it there, it'll look in Path variable. This Path variable contains a list of directories to all programs that you want to be able to execute in your command prompt.

    If the folder where your ng program is was never added to system Path environment variable, Windows will give you ng is not recognized as an internal or external command error, which means it doesn't know where ng.exe file is.

    Note, this error can occur even after you've already installed Angular.

    angular ng is not recognized as an internal or external command, operable program or batch file

    This error means just what it says. In attempt to find a command, executable program, or batch file, Windows failed to do it, after searching anywhere in the system.

    Or just watch this quick YouTube video explaining how to fix git not recognized error:

    How to fix: git not recognized as a command, program or batch file error

    Note, this doesn't necessarily mean ng isn't installed. Just that it isn't added to environment variables.

    In case of ng, however, this means Windows cannot find ng.exe command.

    Type ng version on the command line:

    (Note here I am launching it just from the C:\ drive)

    C:\>ng version
    
         _                      _                 ____ _     ___
        / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
       / โ–ณ \ | '_ \ / _' | | | | |/ _' | '__|   | |   | |    | |
      / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
     /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                    |___/
    
    Angular CLI: 14.2.5
    Node: 18.12.1 (Unsupported)
    Package Manager: npm 8.19.2
    OS: win32 x64

    If this is the message you see, congratulations! This means you can run ng anywhere in command prompt on your hard drive, not just if your command prompt is currently pointing to the Angular's installation directory.

    But what if you get an error every time you run ng command? Like this one:

    C:\>ng version
    'ng' is not recognized as an internal or external command,
    operable program or batch file.

    This is not a ng error. It's a Windows error.

    You can type asdasd into command prompt, and you'll get the same error for asdasd.

    If the folder your Angular was installed in was not added to Environment Variables, you will not be able to run ng command from anywhere on your hard drive, except that folder.

    Adding directory where your ng program resides to system Path variable, will give Windows a hint, where to look for it when calling it from anywhere in the command prompt. This is also why sometimes other programs like VSCode, require you that you add ng to Path variable, so they can run it from their program environment too!

    I wrote this tutorial to help you fix the ng is not recognized as internal or external command error. It may also say operable program or batch file. It might sound confusing, at first. However, this is a fairly common error with a very easy solution.

    How To Fix NG Is Not Recognized As Internal Or External Command

    The actual command name is ng.exe and it's just a Windows executable file, like any other.

    Where is ng.exe located? Usually in the directory where you installed Angular.

    First, identify where Angular is installed on your system.

    This is the folder specified when you were installing it from the official Angular installer file.

    By default it can be somewhere in your Program Files directory.

    However, this is often what you should add to your Path variable, the bin folder.

    C:\Users\username\AppData\Roaming\npm\node_modules\@angular\cli\bin

    Just replace username with your own windows username that you see in C:\Users folder.

    To fix Angular ng is not recognized as internal or external command, operable program or batch file, follow these steps:

    Now for visual speed-learners, let's go over each step in detail:

    Click Start button.

    This one's easy. Just click on Start button from your Windows desktop.

    Start typing "environment variables", and press Enter.

    First, click on Start button and start typing "environment variables."

    add path to environment variables

    You don't even have to finish typing the complete phrase.

    Just press Enter or Open button.

    Click on Environment Variables button, close to lower right corner.

    On this System Properties window that opens, click Environment Variables... button:

    how to find environment variables

    This leads us to the next step.

    Click anywhere in lower box that says System Variables.

    There are two main types of Environment Variables.

    They are displayed on two separate lists on this window:

    user and system variables

    Both lists have the path variable on them. So how do we know which one to choose?

    The upper box is user variables. Click on Path variable to highlight it, then click Edit button, and click on New button to add the folder where your ng program resides.

    We're doing this to make ng available on the command line from any hard drive location, even C:\, and not just the folder where ng was installed. The idea behind user variables is that only the currently logged in Windows user's system configuration will be affected.

    The lower box is called system variables. Adding ng to path here, will end up applying it systemwide. Regardless who is logged in, Windows will recognize ng command anywhere on the command line.

    I personally use system variables, because nobody else is using my computer anyway.

    Scroll down until you see Path variable, and click on it once.

    Choose your list, and scroll down to find Path variable.

    Click on the Path variable just one time to select it.

    Click on Edit button to start editing Path variable.

    Then click Edit button just underneath the list.

    Now this new window should open that looks like this:

    adding python to PATH environment variable

    The Path variable contains multiple entries for all kinds of other programs.

    This is the list to which we need to add the path to the folder where our ng is installed.

    In other words, the directory where the executable file ng.exe is located.

    Click New button to start a new blank variable.

    Now, click on New button to add a new Environment Variable:

    how to add NG environment variable to Path

    Type the location of your Angular installation folder into this new input box.

    Edit environment variables
    โœ•
    C:\Program Files\Git\usr\local\node_modules\@angular\cli\bin
    C:\Windows\System32\
    C:\Windows\
    C:\Program Files\Java\jdk_version\bin
    C:\Program Files (x86)\Java\jre_version\bin
    C:\Program Files (x86)\Java\jdk_version\bin
    C:\Program Files\Git\bin
    C:\Program Files\Git\cmd
    C:\Program Files\Git\
    C:\Program Files\Git\bin
    C:\Program Files\Git\cmd
    C:\Program Files (x86)\Git\
    C:\Program Files (x86)\Git\bin
    C:\Program Files (x86)\Git\cmd
    C:\Users\username\AppData\Local\Programs\Git\
    C:\Users\username\AppData\Local\Programs\Git\bin
    C:\Users\username\AppData\Local\Programs\Git\cmd
    C:\ProgramData\Git\
    C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\
    C:\Program Files\Microsoft SQL Server\120\Tools\Binn\
    C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
    C:\Program Files\Microsoft SQL Server\140\Tools\Binn\
    C:\Program Files\Microsoft SQL Server\140\DTS\Binn\
    C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
    C:\Program Files (x86)\Yarn\bin\
    C:\Program Files\dotnet\
    C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\
    C:\Program Files (x86)\Windows Kits\10\Microsoft Application Virtualization\Sequencer\
    C:\Program Files\Microsoft VS Code\bin
    C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code
    C:\Program Files\Amazon\AWSCLI\bin\
    C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin
    C:\Users\username\AppData\Local\Programs\Python\Python-version\Scripts\
    C:\Users\username\AppData\Local\Programs\Python\Python-version\
    C:\Users\username\AppData\Local\Yarn\bin
    C:\Program Files (x86)\Microsoft Visual Studio\version\VC\bin
    C:\Program Files\Microsoft Visual Studio\version\Common7\IDE\
    C:\Program Files\Microsoft Visual Studio\version\VC\bin
    C:\Program Files\Android\Android Studio\bin
    C:\Users\username\.dotnet\tools
    C:\Program Files\Python\Python-version\Scripts\
    C:\Program Files\Python\Python-version\
    C:\Program Files\Nodejs\
    C:\Program Files\Microsoft Network Monitor 3\
    C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\
    C:\Program Files\Microsoft\Web Platform Installer\
    C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
    C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\
    C:\Program Files\Microsoft MPI\Bin\
    C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler
    C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
    C:\Program Files\Intel\iCLS Client\
    C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
    C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
    C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
    C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
    C:\Program Files (x86)\Intel\iCLS Client\
    C:\Program Files (x86)\Intel\UCRT\
    C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\x86
    C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\x64
    C:\Program Files (x86)\Common Files\Oracle\Java\javapath
    C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
    C:\Program Files\NVIDIA Corporation\NVIDIA NGX
    C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
    C:\ProgramData\chocolatey\bin
    C:\Program Files\Calibre2\
    C:\Program Files (x86)\Gpg4win\..\GnuPG\bin
    C:\Program Files\Git\mingw64\bin
    C:\Program Files\Git\usr\bin
    C:\Program Files (x86)\GNU\GnuPG\pub
    C:\Program Files\iTunes\
    C:\Program Files\iPod\bin\
    C:\Program Files (x86)\QuickTime\QTSystem\
    C:\Program Files\Common Files\Apple\Apple Application Support\
    C:\Program Files (x86)\Common Files\Apple\Apple Application Support\
    C:\Program Files\Common Files\Microsoft Shared\Windows Live
    C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live
    C:\Program Files\Windows Live\Shared
    C:\Program Files (x86)\Skype\Phone\
    C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static
    C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\
    C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
    C:\Program Files\Microsoft SQL Server\120\Tools\Binn\
    C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\
    C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
    C:\Program Files\Microsoft SQL Server\140\DTS\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\
    C:\Program Files (x86)\Windows Kits\10\Microsoft Application Virtualization\Sequencer\
    C:\Program Files (x86)\Yarn\bin\
    C:\Program Files\Microsoft VS Code\bin
    C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code
    C:\Program Files\Amazon\AWSCLI\bin\
    C:\Users\username\AppData\Local\Programs\Microsoft VS Code\bin
    C:\Users\username\AppData\Local\Programs\Python\Python-version\Scripts\
    C:\Users\username\AppData\Local\Programs\Python\Python-version\
    C:\Users\username\AppData\Local\Yarn\bin
    C:\Program Files (x86)\Microsoft Visual Studio\version\VC\bin
    C:\Program Files\Microsoft Visual Studio\version\Common7\IDE\
    C:\Program Files\Microsoft Visual Studio\version\VC\bin
    C:\Program Files\Android\Android Studio\bin
    C:\Users\username\.dotnet\tools
    C:\Program Files\Python\Python-version\Scripts\
    C:\Program Files\Python\Python-version\
    C:\Program Files\Nodejs\
    C:\Program Files\Microsoft Network Monitor 3\
    C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\
    C:\Program Files\Microsoft\Web Platform Installer\
    C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
    C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\
    C:\Program Files\Microsoft MPI\Bin\
    C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler
    C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
    C:\Program Files\Intel\iCLS Client\
    C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
    C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
    C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
    C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
    C:\Program Files (x86)\Intel\iCLS Client\
    C:\Program Files (x86)\Intel\UCRT\
    C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\x86
    C:\Program Files (x86)\Intel\OpenCL SDK\6.1\bin\x64
    C:\Program Files (x86)\Common Files\Oracle\Java\javapath
    C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
    C:\Program Files\NVIDIA Corporation\NVIDIA NGX
    C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
    C:\ProgramData\chocolatey\bin
    C:\Program Files\Calibre2\
    C:\Program Files (x86)\Gpg4win\..\GnuPG\bin
    C:\Program Files\Git\mingw64\bin
    C:\Program Files\Git\usr\bin
    C:\Program Files (x86)\GNU\GnuPG\pub
    C:\Program Files\iTunes\
    C:\Program Files\iPod\bin\
    C:\Program Files (x86)\QuickTime\QTSystem\
    C:\Program Files\Common Files\Apple\Apple Application Support\
    C:\Program Files (x86)\Common Files\Apple\Apple Application Support\
    C:\Program Files\Common Files\Microsoft Shared\Windows Live
    C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live
    C:\Program Files\Windows Live\Shared
    C:\Program Files (x86)\Skype\Phone\
    C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static
    C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\Client SDK\ODBC\130\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\DTS\Binn\
    C:\Program Files (x86)\Microsoft SQL Server\140\Tools\Binn\ManagementStudio\
    C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\PrivateAssemblies\
    C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\
    C:\Program Files\Microsoft SQL Server\120\Tools\Binn\
    C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\
    C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
    New
    Edit
    Browse...
    Delete
    Move Up
    Move Down
    Edit text...
    OK
    Cancel

    Type path to where your NG is installed on your system.

    Simply start typing the path.

    For example: C:\Angular\bin\.

    Whatever the folder is where GIt was installed.

    Click Okay button 3 times in a row to exist and save your path variable.

    Press Enter to confirm your path.

    Now to exit out of all Environment Variables windows, click Okay button 3 times, until all windows disappear.

    Congratulations! At this point your ng has been added to system Path using environment variables.

    Go to your cmd.exe and navigate to C:\ drive to verify if you can call ng command:

    C:\>ng version
    Angular CLI: 14.2.5
    Node: 18.12.1 (Unsupported)
    Package Manager: npm 8.19.2
    OS: win32 x64

    As you can see you can now call ng on command line from any hard drive location. This means other programs like VSCode, or Visual Studio, can call this command too from their own environments.

    It took hours to put this material together. Please help me out by sharing it ๐Ÿ™‚

    Click button below to share link on WhatsApp or Discord or with friends:

    Hope this helps someone ๐Ÿ™‚ Please share this page!

    Write For Us
    Sign Up Now  -  It's Free!

    How To Fix Angular's ng Is Not Recognized As An Internal Or External Command

    Comments (2) New! (You can now post comments on articles!)

    (By posting a comment you are registering a Ghost Together account.)
    Register
    Register
    Post It
    DM Coming Soon
    f f