16

I'm completely new to Gulp but I wanted to try it out. Due to restrictions/admin rights on my desktop and moving about a lot, I need things portable, and so am currently running everything I need off a stick.

I've browsed similar posts but none of the solutions seemed to solve the problem I'm having.

I used the following commands in cmd with Ruby to install gulp -

npm install -g gulp

and then

npm install --save-dev gulp

I'm seeing the folders and files, but when I run gulp -v in cmd I get the following:

" 'gulp' is not recognized as an internal or external command, operable program or batch file."

I'm not sure if this is a problem related to the fact I don't have admin rights for this computer or not. Any help so I can troubleshoot further would be much appreciated!

E:\xampp\htdocs\wordpress>PATH
PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32
\WindowsPowerShell\v1.0\;C:\Program Files\nodejs\;C:\RailsInstaller\Git\cmd;C:\R
ailsInstaller\Ruby1.9.3\bin

Thanks

7 Answers 7

25

My Full Response

Solution

  1. Re-download nodejs
  2. npm install -g gulp
  3. gulp -version
Sign up to request clarification or add additional context in comments.

Comments

10

I had the same problem when I installed gulp, I was not able to run gulp in command line. I was getting the following error:

'gulp' is not recognized as an internal or external command, operable program or batch file.

After doing some re-search I found that I needed to update the Path variable. Following is the command you can run in command line to add the path to the system path variable.

C:\> PATH=%PATH%;C:\Users\**<username>**\AppData\Roaming\npm

1 Comment

For a persistent solution, consider modifying the PATH using the Windows menu entry "User environment variables"
2

Using VS2017, Net CORE 1.1 I received this error. I ran the following in a command window at the root of my project:

cmd.exe /c gulp --tasks-simple 

This showed me the real error in a stack trace: there was a typo in my gulpfile.js.

So for me the problem was a simple typo and had nothing to do with gulp, npm or installation.

1 Comment

Thanks so much for this answer! After running the command it was revealed I needed to rebuild node-sass. The VS error alone would never have led me to that.
1

Seems that you didn't configured the /bin folder of your node installation in the PATH variable, however in windows it should be done automatically. The PATH in your question refers to C:\Program Files\nodejs. You can add the environment variable manually or download the latest version and try again.

For those using linux, (if downloaded the Linux Binaries (.tar.xz)) please add, in your home (~/.bashrc), the export of node's bin folder, like:

    export PATH=$PATH:/opt/node/bin

Comments

1

1- Check Is NPM Global installer installed the gulp or other package what you looking for the default path is "C:\Users\YOUR_USER\AppData\Roaming\npm"

If the gulp executable on there you have installed it globally. If not install it globally. Like above right:

npm install -g gulp

2- Add it to windows environment system variables like that to working with it on your local IDE

NODE_PATH %AppData%\Roaming\npm\node_modules
GULP_PATH %AppData%\AppData\Roaming\npm
NPM_PATH %AppData%\AppData\Roaming\npm   <- one of them 

Comments

0

If someone is having this issue with an npm script that uses gulp, and with gulp as a dev dependency in your package.json, you shouldn't need to install gulp globally, I fixed it by doing a clean install.

npm ci

Comments

-2

It sounds like theres some information missing, and while Im a bit confused about the 'commands in cmd with Ruby' this might set you down the right path.

After you install Gulp globally, as you did; npm install -g gulp, you want to cd into your project root and npm install gulp --save-dev. This is all outlined in this article, which is recommended alongside some other getting started articles by Gulp.

6 Comments

Thanks mw_. I tried again but still "gulp -v" gives me that error. I thought perhaps it may be down to the ordering of the local install as I noticed yours differed from mine slightly, but no luck as yet.
Hmmm. Check that your environment and path are setup correctly. I came across a similar question, and it looks like there's a few solutions worth exploring.
Thanks mw_. I'm getting the "INFO: Could not find files for the given pattern(s)." message when I try "where gulp". I ran "PATH" in cmd and have got this back (see edit in original post). Not really sure what I'm looking at but I'm guessing "C:\Users\Username\AppData\Roaming\npm\" should feature in the response. I wonder if it's because I installed Gulp on my stick and/or my lack of admin rights for the machine I'm using.
Im on OSX so Windows it out of my "area". Have a look at that link in my last comment again, and make sure your NODE_PATH bit is correct. Im not really sure where to go from here, but I know it involves getting your environment correctly configured. I don't think the stick (you mean USB right?) is going to be the way to go, so maybe consider creating a folder on the machine, and install everything fresh???
Yeah, so you make OP install gulp globally and then install it locally, what's the point?
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.