Reputation: 947
I've seen that in some tutorials when you install Gulp it suggests:
npm install -g gulp
In other tutorials it suggests:
npm install -g gulp-cli
What is the difference, and what relevance does the suffix cli have? I appreciate it means command line interface, but does this have any added benefits, or are they both the same thing.
Also, all tutorials suggest installing packages like gulp globally, but then you have to install them as a dev dependency in the project anyway - why do you essentially end up having to install it twice?
Many thanks
Upvotes: 1
Views: 9801
Reputation: 1672
gulp-cli
is just the cli
part of this tool, whereas gulp
is both the cli + the library bundled together. This package was initially bundled together as gulp
but to better support multiple major versions (with API changes) the CLI / Library were split. This way, the CLI could leverage the library version that was installed as part of your project dependency -- as global NPM packages should.
Installing the package globally, just allows you to reference the CLI tool by name, without including the path to your node_modules
directory, e.g. gulp
vs. ./node_modules/bin/gulp
The team also wrote a very brief update to summarise some of this, see: https://medium.com/gulpjs/gulp-sips-command-line-interface-e53411d4467
Upvotes: 3