Module is not Recognized as an Internal or External Command
Table of Contents
- Introduction
- How to Enable Gulp
- How to Enable Bower
- Git is Not Recognized Too?
- How to Enable Yo
- Still Not Working!?
- Conclusion
Introduction
You'll often see the following errors when running npm commands on a Windows OS system.
'Gulp' is not recognized as an internal or external command, operable program or batch file.
'Bower' is not recognized as an internal or external command, operable program or batch file.
'yo' is not recognized as an internal or external command, operable program or batch file.
Basically, you have to add the appropriate paths to the Environment Variables' Path.
How to Enable Gulp
For gulp, you will have to add the following path to the Path System Variables so the command line will recognize npm's global path. Also, install gulp so the gulp command will be recognized. At the end, you'll have to restart the command line if you haven't done so after changing the system variables.
- Add path to Windows System Variables
-
%USERPROFILE%\AppData\Roaming\npm
-
C:\Program Files\nodejs\
-
Run the npm install command to install gulp:
- `npm install -g gulp`
Restart Windows command line.
How to Enable Bower
If you have already set up gulp, then the only thing you have to do is run npm for bower as a global package.
npm install -g bower
Git is Not Recognized Too?
-
Go to Windows' Environment Variables and edit the Path variables. Make sure they contain the following paths, and also make sure Git actually exists at those locations.
- Could be either of these:
-
%PROGRAMFILES(x86)%\Git\bin -
%PROGRAMFILES(x86)%\Git\cmd
-
Or maybe:
-
%PROGRAMFILES%\Git\bin -
%PROGRAMFILES%\Git\cmd
- Could be either of these:
How to Enable Yo
It is the same as bower at this point. You will need to install Yeoman globally.
npm install -g yo
If you can't install yo and the command line displays an error containing If you are behind a proxy, please make sure that the 'proxy' config is set properly, try running npm config ls -l. This command will show all the config settings for npm. Check the proxy — if the proxy is null, change it to http://registry.npmjs.org/ with the following command:
npm config set registry http://registry.npmjs.org/
Still Not Working!?
Before trying to figure out what's happening, restart your command line again — it might work. Also, it is better to use the Node.js command prompt.
Conclusion
The "not recognized as an internal or external command" error on Windows is typically caused by missing paths in the system's Environment Variables. By adding the correct npm and Node.js paths, installing packages globally, and restarting the command line, you can resolve these issues for gulp, bower, yo, and Git.