Gulp - The term 'gulp' is not recognized as the name of a cmdlet
Asked Answered
P

7

14

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

Paintbox answered 1/4, 2017 at 11:9 Comment(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?Paintbox
Revert it to the original path and add the path to ruby to the end of the original path.Hemmer
I didn't have a path before. So I tried deleting it and it is still in the same condition :OPaintbox
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.Paintbox
Possible duplicate of gulp command not found - error after installing gulpBitter
D
28

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)

Dietrich answered 17/9, 2018 at 10:17 Comment(0)
S
9

I know this is a bit late to answer this 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

Seraglio answered 22/11, 2019 at 8:30 Comment(1)
Apparently running npm install gulp --save-dev is not sufficient, it really needs to be installed as a global package npm install gulp -gEquivalency
M
6

Since gulp is a dev dependency, it should not be installed globally,instead run inside of your project npm install gulp --save-dev and to run gulp run npx gulp which will run your gulpfile. enter image description here

Maciemaciel answered 12/11, 2021 at 5:45 Comment(0)
H
2

Install gulp globally:

npm install gulp -g

Install gulp locally inside your project folder:

npm install gulp --save-dev

After doing both, I still got the same error when I straight-up run gulp commands, but they run when my command includes npx, like so:

npx gulp
npx gulp trust-dev-cert
npx gulp serve
Hazeghi answered 7/11, 2022 at 13:20 Comment(0)
E
0

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

Epiboly answered 28/6, 2017 at 19:37 Comment(0)
D
0

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.

Doodlebug answered 18/6, 2019 at 6:50 Comment(0)
D
0

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

Diuretic answered 24/9, 2021 at 11:47 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.