gulp-“cli”是什么?代表? [英] what does gulp-"cli" stands for?

查看:971
本文介绍了gulp-“cli”是什么?代表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  $ npm install  - 可以解释以下两种安装方法的区别:全球gulp-cli 

  $ sudo npm install -g gulp 

在我看来,做同样的事情,除了第一个方法给我一个版本1.2.1,后者给我版本3.9.1

有人可以用简单的术语来说明究竟是什么差异?加上什么是cli代表?

解决方案

gulp-cli的目标是让您像全球一样使用gulp计划,但没有在全球安装饮用水。



例如,如果您全局安装gulp 3.9.1,并且您的项目testGulp4在本地安装了gulp 4.0,那么运行 gulp -v会发生什么情况 into testGulp4?




  • 全局安装gulp-cli:

      CLI版本3.9.1 

    在这种情况下,显示的版本是gulp的全球版本。本地版本4.0完全被忽略。


  • 全球安装gulp-cli:

      CLI版本1.2.1 
    本地版本4.0.0-alpha.2

    在这种情况下,显示的版本是gulp-cli的全球版本和gulp的本地版本。全球吞吐量3.9.1完全被忽略。

  • 结论:




    • gulp-cli:是首选,因为它允许您使用不同版本的gulp。

    • gulp:需要a安装本地版本的gulp。


    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?

    解决方案

    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.

    这篇关于gulp-“cli”是什么?代表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆