what does gulp-"cli" stands for?

York Wang picture York Wang · Feb 23, 2016 · Viewed 16.9k times · Source

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?

Answer

N. Brun picture N. Brun · Feb 23, 2016

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.