3

Installing grunt globally:

$npm install grunt-cli -g

trying to check one:

$grunt -v
grunt-cli: The grunt command line interface (v1.2.0)

Fatal error: Unable to find local grunt.

If you're seeing this message, grunt hasn't been installed locally to
your project. For more information about installing and configuring grunt,
please see the Getting Started guide:

http://gruntjs.com/getting-started

More details:

$ which grunt
/usr/bin/grunt
Serhii
  • 223

1 Answers1

1

I know this is an old post, but I thought I'd paste and explain a specific quote from the Grunt documentation for anyone running into this misconception/issue.

Each time "grunt" is run, it looks for a locally installed Grunt using node's require() system. Because of this, you can run grunt from any subfolder in your project.

Source here.

Yes, even though the CLI was installed using the -g flag, grunt-cli requires a Gruntfile.(either .js or .coffee), even to run commands utility commands like -v or --help

William
  • 26