Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grunt-cli and Grunt - Same app, two versions?

Tags:

Achtung!

The accepted answer answered my question at the time, but is now outdated. Back then grunt-cli used grunt, but with another branch. The not-accepted answers will tell you how it is today.

Question

What is the relations and differences between grunt-cli and grunt? It seems to be the same thing, but different versions.

Grunt

https://npmjs.org/package/grunt

https://github.com/gruntjs/grunt

Grunt-cli

https://npmjs.org/package/grunt-cli

https://github.com/gruntjs/grunt/blob/devel/docs/getting_started.md

like image 388
He Nrik Avatar asked Dec 04 '12 14:12

He Nrik


People also ask

How do I install a specific version of Grunt command line?

Installing a specific version If you need a specific version of Grunt or a Grunt plugin, run npm install grunt@VERSION --save-dev where VERSION is the version you need. This will install the specified version, adding it to your package.

What is npm install Grunt CLI?

npm install -g grunt-cli. This will put the grunt command in your system path, allowing it to be run from any directory. Note that installing grunt-cli does not install the Grunt task runner! The job of the Grunt CLI is simple: run the version of Grunt which has been installed next to a Gruntfile .


2 Answers

You're correct, the two projects exist because of different versions of grunt.

grunt-cli is used for grunt version 0.4 (and has an explicit dependency on 0.4), which as of this writing is in alpha development. grunt-0.4 splits the command line interface (grunt-cli) from the API libraries.

The "Getting Started" documentation you found is in the devel branch of the grunt repository, which will be the 0.4 release.

If you're using grunt 0.3.x, then you don't need to install grunt-cli.

like image 164
smithclay Avatar answered Oct 03 '22 17:10

smithclay


As far as I know, grunt-cli is simply a tool to access Grunt from command line anywhere in the system, but it doesn't include Grunt itself. In other words, Grunt-CLI only looks for locally installed Grunt files somewhere in the filesystem, but it doesn't have the functionality of the regular Grunt.

like image 27
alemangui Avatar answered Oct 03 '22 18:10

alemangui