. Advertisement .
..3..
. Advertisement .
..4..
I get an error
D:\www\grunt-test\grunt grunt-cli: The grunt command line interface.
(v0.1.4)
Fatal error: Unable to find local grunt.
If you're seeing this message, either a Gruntfile wasn't found or
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
when trying to remove the old version of grunt first, then I installed the new grunt version. How to fix the fatal error: unable to find local grunt. error? Please give me some advice.
The cause: You get the fatal error: unable to find local grunt because your project directory lacks a
grunt.js
file.Solution:
To solve this kind of error, you can use
grunt:init
to access options likejQuery, node, commonjs
. Choose what you desire, then carry on. This is effective.It will work if you do it like this:
Fix for v1.4:
The new version’s solution updated:
Grunt should be installed in node_modules, not globally
Unable to find local Grunt
is likely to mean that Grunt has been installed globally.Grunt CLI requires that grunt be installed in your local directory of node_modules, so Grunt can be found within your project.
This will not work:
Instead, do this: