7
votes

Started getting this random error when I started a new project and made a new gulpfile.

I get it whenever I run gulp. It isn't just on this project it has started happening on all other projects.

I have read that there might be an issue with environment variables so I have updated these.

I have also recently ran the ruby installer.

Screenshot below shows my environment variables:

enter image description here I'm at a deadend.. Would appreciate some help.

Cheers

Update - Full Error message after running gulp:

gulp : The term 'gulp' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + gulp + ~~~~ + CategoryInfo : ObjectNotFound: (gulp:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException

5
I have set the path in the variables myself. As I read this is somethign you need to do. any ideas how to fix?MaxwellLynn
Revert it to the original path and add the path to ruby to the end of the original path.Sulthan
I didn't have a path before. So I tried deleting it and it is still in the same condition :OMaxwellLynn
Yeah so I've tried deleting it and doing a restart to my machine to see if it is effected. I have also tried removing the node variable as well just incase. Seem to still be getting the same problem though.MaxwellLynn

5 Answers

13
votes

In my case it was that I had to install gulp-cli by command npm -g install gulp-cli (also I had to install gulp localy in project)

3
votes

I know this is a bit late to answer to question but who knows someone else might need it too. All you need to do is install gulp globally: npm install gulp -g and it will work just fine

0
votes

I ran into this issue when I updated to the newest version of NPM. I reinstalled Node to version 6.11 and all my problems were solved. I was running Node 8.1 previously.

Node Downloads Page: https://nodejs.org/en/download/

If you go this route, ensure that the installer will add the necessary routes to your machine's path.

Node Installer - Add to Path

0
votes

I too get that same issue sometimes. It got solved by below steps. It might get solved with 1st step itself sometimes.

  1. Uninstall and install both node and gulp(global and local)

  2. Run npm config rm proxy

  3. Run npm config set registry http://registry.npmjs.org/

  4. Check path variables. Type environment variables in Windows and edit it to your installed path.

0
votes

Mine got solved with these 2 lines:

npm -g install gulp

then

npm -g install gulp-cli

I also installed both gulp and gulp-cli locally (i.e. inside the project):

npm install gulp gulp-cli

and all worked.

I think Gulp needs GLOBAL installation before it will work