Fatal error: Unable to find local grunt.

scmuser created the topic: Fatal error: Unable to find local grunt.
I am getting following error…

grunt lite
grunt-cli: The grunt command line interface. (v0.1.9)

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:

gruntjs.com/getting-started

Solution

The command line tools are not included with the latest version of Grunt (0.4 at time of writing) instead you need to install them separately.

This is a good idea because it means you can have different versions of Grunt running on different projects but still use the nice concise grunt command to run them.

So first install the grunt cli tools globally:

npm install -g grunt-cli

(or possibly sudo npm install -g grunt-cli ).

You can establish that’s working by typing grunt –version

Now you can install the current version of Grunt local to your project. So from your project’s location…

npm install grunt –save-dev

The save-dev switch isn’t strictly necessary but is a good idea because it will mark grunt in its package.json devDependencies section as a development only module.

rajeshkumar replied the topic: Fatal error: Unable to find local grunt.
while running “npm install -g grunt-cli”, i got following code…

npm http GET registry.npmjs.org/grunt-cli
npm http 304 registry.npmjs.org/grunt-cli

npm ERR! Error: No compatible version found: grunt-cli
npm ERR! No valid targets found.
npm ERR! Perhaps not compatible with your version of node?
npm ERR! at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR! at next_ (/usr/share/npm/lib/cache.js:438:17)
npm ERR! at next (/usr/share/npm/lib/cache.js:415:44)
npm ERR! at /usr/share/npm/lib/cache.js:408:5
npm ERR! at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR! at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR! < bugs.debian.org/npm >
npm ERR! or use
npm ERR! reportbug –attach /home/scmbuild/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.2.0-53-generic
npm ERR! command “node” “/usr/bin/npm” “install” “-g” “grunt-cli”
npm ERR! cwd /home/scmbuild
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: grunt-cli
npm ERR! message No valid targets found.
npm ERR! message Perhaps not compatible with your version of node?
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/scmbuild/npm-debug.log
npm not ok
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Fatal error: Unable to find local grunt.
Seems like node is older version so need to user latest…
How to upgrade nodes in Ubantu
Install the dependencies:

sudo apt-get install g++ curl libssl-dev apache2-utils
sudo apt-get install git-core

Run the following commands:

git clone git://github.com/ry/node.git
cd node
./configure
make
sudo make install

How to install grunt
Here’s what I did to fix this:

Uninstalled grunt globally:

npm uninstall -g grunt

Installed grunt-cli globally:

npm install -g grunt-cli

Then, in project root dir:

npm install

And all is good. Hope this works for anyone else running into this.
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Fatal error: Unable to find local grunt.
After running latest nodes, while using folliowing commands i got following error…”npm install -g grunt-cli”

module.js:333
throw err;
^
Error: Cannot find module ‘graceful-fs’
at Function.Module._resolveFilename (module.js:331:15)
at Function.Module._load (module.js:273:25)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at Object. (/usr/share/npm/lib/utils/ini.js:32:10)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:349:32)
at Function.Module._load (module.js:305:12)
at Module.require (module.js:357:17)
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

rajeshkumar replied the topic: Fatal error: Unable to find local grunt.
From in stacekoverlfow..

Don’t download npm from aptitude or apt-get. Instead try:

git clone git://github.com/isaacs/npm.git
cd npm/scripts
chmod +x install.sh
sudo ./install.sh

saw it here: NPM can’t install appjs. Error: Cannot find module ‘graceful-fs’

or

sudo npm install

or

sudo apt-get remove npm
sudo apt-get install npm
Regards,
Rajesh Kumar
Twitt me @ twitter.com/RajeshKumarIn

Tagged :
0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x