First run npm -g install gulp-cli then run gulp -v. Alternatively, you can just run npm list gulp.
To solve the error "'gulp' is not recognized as an internal or external command, operable program or batch file", install the gulp-cli package globally by running npm install -g gulp-cli , restart your terminal and make sure your PATH environment variable is set up correctly.
The global npm directory is where your packages get installed when you install them globally. You can check where it is by typing in npm root -g in the command line. For Mac users, if the root command returns a directory like /Users/YOURNAME/node_modules then this will cause the command not found error.
You forgot to install the gulp-cli package:
npm install -g gulp-cli
Then you can run the command "gulp" from the command line.
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:
NODE_PATH
%AppData%\npm\node_modules
or %AppData%\npm
on windows 8-10Running npm ls
and npm ls -g
shows that they are installed, but the CMD can not find them due to the missing link
.
gulp.cmd
(use windows search)
gulp.cmd
(C:\Users\XXXX\AppData\Roaming\npm
)
PATH
environment variable and add %APPDATA%\npm
Add %APPDATA%\npm
to front of Path, not end of the Path.
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.
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
Had the same problem, not really best solution but install it globally:
npm install -g gulp
Of course it's best to still have it in package.json
, so you can do the following to install it locally and add an entry into package.json
:
npm install --save-dev gulp
Everything else (gulp plugins) install also locally.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With