Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
505 views
in Technique[技术] by (71.8m points)

task - what does gulp-"cli" stands for?

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?

question from:https://stackoverflow.com/questions/35571679/what-does-gulp-cli-stands-for

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...