gulp command not found - error after installing gulp
Solution 1:
You forgot to install the gulp-cli package:
npm install -g gulp-cli
Then you can run the command "gulp" from the command line.
Solution 2:
The issue and answer can be found in this question: https://stackoverflow.com/a/9588052/1041104
The npm modules such as gulp are not installed to the path. Thus are not found when you run them in the CMD.
If gulp has been installed globally, you can use the process below:
- Create an environmental variable called
NODE_PATH
- Set it to:
%AppData%\npm\node_modules
or%AppData%\npm
on windows 8-10 - Close CMD, and Re-Open to get the new ENV variables
Running npm ls
and npm ls -g
shows that they are installed, but the CMD can not find them due to the missing link
.
Solution 3:
- Be sure that you have gulp and
gulp.cmd
(use windows search) - Copy the path of
gulp.cmd
(C:\Users\XXXX\AppData\Roaming\npm
) - Add this path to the Path envirement variable or edit
PATH
environment variable and add%APPDATA%\npm
- Reopen cmd.
Add %APPDATA%\npm
to front of Path, not end of the Path.
Solution 4:
-
Install gulp globally.
npm install -g gulp
-
Install gulp locally in the project.
npm install gulp
-
Add below line in your package.json
"scripts": { "gulp": "gulp" }
-
Run gulp.
npm run gulp
This worked for me.
Solution 5:
I am using Windows 8.1. I had the same problem.
I installed gulp using Node.js command prompt
npm install -g gulp
Then go to the required directory in Node.js command prompt and try
gulp -v
If you get gulp local version not found exit the current Node.js command prompt and try the above command in a new Node.js command prompt
I tried the NODE_PATH mentioned by @SteveLacy but the command prompt was still not able to detect gulp command