2

I am trying to install gulp via npm so that I can run my project.

As far as I can tell, all I need to do is run "npm install gulp" from the command line of my project location like so :

enter image description here

However it doesn't seem to work, because if I run "gulp" from the command line nothing happens.

enter image description here

In my package.json file I have these dependencies :

 "devDependencies": {
 "autoprefixer-stylus": "^0.7.1",
 "browser-sync": "^2.8.2",
 "gulp": "^3.9.0",
 "gulp-cache": "^0.3.0",
 "gulp-concat": "^2.6.0",
 "gulp-if": "^1.2.5",
 "gulp-imagemin": "^2.3.0",
 "gulp-minify-html": "^1.0.4",
 "gulp-nunjucks-html": "^1.2.2",
 "gulp-order": "^1.1.1",
 "gulp-plumber": "^1.0.1",
 "gulp-stylus": "^2.0.6",
 "gulp-uglify": "^1.2.0",
 "gulp-util": "^3.0.6",
 "jeet": "^6.1.2",
 "kouto-swiss": "^0.11.13",
 "minimist": "^1.1.3",
 "rupture": "^0.6.1"
 },

Is there some kind of conflict happening with my package.json file?

If I run "npm install grunt" from an empty directory I get this :

enter image description here

Sorry, I'm very new to npm, grunt, gulp etc.. :(

asked Nov 20, 2015 at 12:54

3 Answers 3

7

You need to install gulp globally too:

npm -g install gulp
answered Nov 20, 2015 at 12:56

3 Comments

Damn. This caught me out again ;)
Gulp still a thing? :D
Grunt perhaps ?
3

Install globally and make sure it is in your path. here is more info -> https://stackoverflow.com/a/24042936/173234

answered Nov 20, 2015 at 12:58

Comments

3

This is a combo of understanding npm and PATH settings. When you run npm install gulp, or npm install in general, it installs that module inside of the current directory under the node modules directory. So if you are in C:\Oliver\test and you run npm install gulp, it will install gulp in C:\Oliver\test\node_modules\gulp. Since the PATH variable, which is a variable that contains a list of directories to look up executables (like gulp), doesn't specify the C:\Oliver\test\node_modules\gulp directory, it will never find the gulp command. To solve this, you need to use the npm install -g command where the -g flag specifies a global install, which means it puts it somewhere that is available in the PATH (I'm not sure where this is on Windows).

answered Nov 20, 2015 at 13:08

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.