How to fix error: “gulp is not recognized as an internal or external command”
If you’re running
gulp on the command line and you get an error like: gulp is not recognized as internal or external command
Or: The term ‘gulp’ is not recognized as the name of a cmdlet, function, script file, or operable program.
This usually means that you need to install the Gulp CLI globally on your computer and check that npm is added to your Path environment variables.
Install Gulp globally
To install Gulp globally, first make sure you have Node.js installed on your computer. If you don’t have it, you can download it from NodeJS.org.
Once you have Node installed, install the Gulp CLI globally by running
npm install -g gulp-cli on your command line.
Note: If you’re running an old version of Gulp where you’ve installed the
gulppackage globally, you’ll have to uninstall it before installing the Gulp CLI. Run
npm uninstall -g gulpfirst.
Check that npm is added to your Path environment variables
If you have Gulp globally installed, but are still getting an error, check that you have your global npm added to your Path.
In Windows, click the Start menu and type in “environment,” then select “Edit the system environment variables.”
A “System Properties” window should pop up. In the window, click “Environment Variables,” then in the new pop-up window, under “User variables for USERNAME” (where “USERNAME” is whatever your own username is) doulble-click or edit the “Path” entry.
In the list of environment variables, check that there is an entry called
C:\Users\USERNAME\AppData\Roaming\npm. If there isn’t one, click “New” and add that entry, then hit “OK” to save.
Once your global npm directory is added, restart your CLI (command line interface) and it should work.
I'm making a course that will teach you how to build a real-world responsive website from scratch!Learn more