0

The getting started for gulp is:

npm install --global gulp
npm install --save-dev gulp

I understand the first install is to install the binary in global path, but ..

  • what is the point of the 2nd install?
  • can't it be also global?
Ryan
  • 10,041
  • 27
  • 91
  • 156

1 Answers1

0

It's meant for version/dependency control. For example, lets say you have a project that uses version 1.0.1 of a gulp plugin.

But what happens if a person wants to fork that project from github, packagist or wherever?

They might have the same plugin installed globally on their system but the version is 2.0.1 Assuming the plugin uses standard semantics on version control the only time you increment the first number is when the changes may cause breaks in other dependencies when compared to the previous versions.

Instead of using the new 2.0.1 version in the project that causes breaks / errors by including the dev version (1.0.1) in the repository (project) you eliminate this problem

marblewraith
  • 768
  • 5
  • 16
  • Then what is the point of the global gulp install, if the only thing that is important is the version of the local gulp install that is specified in the `packages.json` file? – Jake Wilson Sep 09 '14 at 03:31
  • [Screenshot](http://puu.sh/bvDek.png) Take a look, the gulp plugins are installed and are both listed as packages within package.json however the gulp framework (which the 2 packages depend on) is installed globally, allowing me to use it in other projects without having multiple copies. It lets me use different gulp setups for each project i have without having to install the gulp framework multiple times. – marblewraith Sep 12 '14 at 05:51
  • However it is useful to have the flexibility to have multiple copies because if something should change in a project that uses a specific type of plugin it wont break because you can use a different version of gulp from all the rest if you need to. This is more of a version control issue then a technical one. – marblewraith Sep 12 '14 at 05:57