Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what does gulp-"cli" stands for?

Tags:

gulp

task

runner

Can someone please explain what exactly are the differences between the following two methods of gulp installation:

$ npm install --global gulp-cli 

and

$ sudo npm install -g gulp  

It looks to me that both do the same thing except that the first method gives me a version 1.2.1, and the later gives me version 3.9.1

Can someone put into simple terms what exactly are the differences? and plus what is "cli" stands for?

like image 820
York Wang Avatar asked Feb 23 '16 07:02

York Wang


People also ask

What is gulp used for?

Gulp is a tool that helps you out with several tasks when it comes to web development. It's often used to do front end tasks like: Spinning up a web server. Reloading the browser automatically whenever a file is saved.

How do I download gulp from command line?

To install the Gulp CLI globally, on your command line, run npm install gulp-cli -g . The -g flag means npm will install the package in the global npm directory, so you can run the gulp command from any directory.

How do I find gulp version?

First run npm -g install gulp-cli then run gulp -v.

Is gulp deprecated?

`gulp-util` is deprecated and their is a new version with upgrade instructions.


2 Answers

The goal of gulp-cli is to let you use gulp like a global program, but without installing gulp globally.

For example if you installed gulp 3.9.1 globally and your project testGulp4 has gulp 4.0 installed locally, what would happen if you run gulp -v into testGulp4?

  • Without gulp-cli globally installed :

    CLI version 3.9.1 

    In this case the version displayed is the global version of gulp. The local version 4.0 is totally ignored.

  • With gulp-cli globally installed :

    CLI version 1.2.1 Local version 4.0.0-alpha.2 

    In this case the version displayed is the global version of gulp-cli and the local version of gulp. The global gulp 3.9.1 is totally ignored.

Conclusion :

  • gulp-cli: is preferred because it allows you to use different versions of gulp.
  • gulp: needs a local version of gulp installed.
like image 116
N. Brun Avatar answered Sep 23 '22 13:09

N. Brun


CLI stands for Command Line Interface.

gulp is a JavaScript library. It lets you use gulp from JavaScript code.

gulp-cli is a utility program that lets you access gulp from your shell.

like image 32
Quentin Avatar answered Sep 21 '22 13:09

Quentin