Jamie
Jamie

Reputation: 10886

Gulp not installed globally?

I've installed Gulp like this:

npm install gulp -g

When I try gulp -v I get this:

[16:19:03] CLI version 3.9.1

But when I try to use gulp in my project by running gulp enter code here I receive:

[16:20:40] Local gulp not found in ~/Code/gulp
[16:20:40] Try running: npm install gulp

What is wrong?

Upvotes: 1

Views: 3406

Answers (2)

the_5imian
the_5imian

Reputation: 896

Gulp requires two parts to work in any project:

  1. the gulp object that has the 5 functions attached, (src,dest, watch, run, task). this is installed locally for a project, as well as all the plugins necessary, because it is included in your taskfiles such as gulpfile.js. Its a locally imported module.

npm install --save-dev gulp

  1. the gulp-cli, because this is a command line utility, that can be called from anywhere on your computer. Its a globally accessible cli command. You console needs to be able to see it. You do not import this.

npm install -g --save gulp-cli

you can see more here: https://www.npmjs.com/package/gulp-cli/tutorial

Upvotes: 3

Nhan
Nhan

Reputation: 3895

You have to install gulp inside your project:

npm install --save-dev gulp

Upvotes: 0

Related Questions