{"id":2160,"date":"2017-12-07T12:01:16","date_gmt":"2017-12-07T12:01:16","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/?p=2160"},"modified":"2020-01-09T09:45:04","modified_gmt":"2020-01-09T09:45:04","slug":"fatal-error-unable-to-find-local-grunt","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/fatal-error-unable-to-find-local-grunt\/","title":{"rendered":"Fatal error: Unable to find local grunt."},"content":{"rendered":"<p><strong>scmuser created the topic: Fatal error: Unable to find local grunt.<\/strong><br \/>\nI am getting following error&#8230;<\/p>\n<p>grunt lite<br \/>\ngrunt-cli: The grunt command line interface. (v0.1.9)<\/p>\n<p>Fatal error: Unable to find local grunt.<\/p>\n<p>If you&#8217;re seeing this message, either a Gruntfile wasn&#8217;t found or grunt<br \/>\nhasn&#8217;t been installed locally to your project. For more information about<br \/>\ninstalling and configuring grunt, please see the Getting Started guide:<\/p>\n<p>gruntjs.com\/getting-started <\/p>\n<p>Solution<\/p>\n<p>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.<\/p>\n<p>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.<\/p>\n<p>So first install the grunt cli tools globally:<\/p>\n<p>npm install -g grunt-cli<\/p>\n<p>(or possibly sudo npm install -g grunt-cli ).<\/p>\n<p>You can establish that&#8217;s working by typing grunt &#8211;version<\/p>\n<p>Now you can install the current version of Grunt local to your project. So from your project&#8217;s location&#8230;<\/p>\n<p>npm install grunt &#8211;save-dev<\/p>\n<p>The save-dev switch isn&#8217;t strictly necessary but is a good idea because it will mark grunt in its package.json devDependencies section as a development only module.<\/p>\n<p><strong>rajeshkumar replied the topic: Fatal error: Unable to find local grunt.<\/strong><br \/>\nwhile running &#8220;npm install -g grunt-cli&#8221;, i got following code&#8230;<\/p>\n<p>npm http GET<a href=\"http:\/\/registry.npmjs.org\/grunt-cli\" target=\"_blank\" rel=\"noopener\"> registry.npmjs.org\/grunt-cli <\/a><br \/>\nnpm http 304 <a href=\"http:\/\/registry.npmjs.org\/grunt-cli\" target=\"_blank\" rel=\"noopener\">registry.npmjs.org\/grunt-cli <\/a><\/p>\n<p>npm ERR! Error: No compatible version found: grunt-cli<br \/>\nnpm ERR! No valid targets found.<br \/>\nnpm ERR! Perhaps not compatible with your version of node?<br \/>\nnpm ERR! at installTargetsError (\/usr\/share\/npm\/lib\/cache.js:488:10)<br \/>\nnpm ERR! at next_ (\/usr\/share\/npm\/lib\/cache.js:438:17)<br \/>\nnpm ERR! at next (\/usr\/share\/npm\/lib\/cache.js:415:44)<br \/>\nnpm ERR! at \/usr\/share\/npm\/lib\/cache.js:408:5<br \/>\nnpm ERR! at saved (\/usr\/share\/npm\/lib\/utils\/npm-registry-client\/get.js:147:7)<br \/>\nnpm ERR! at Object.oncomplete (\/usr\/lib\/nodejs\/graceful-fs.js:230:7)<br \/>\nnpm ERR! You may report this log at:<br \/>\nnpm ERR! < bugs.debian.org\/npm ><br \/>\nnpm ERR! or use<br \/>\nnpm ERR! reportbug &#8211;attach \/home\/scmbuild\/npm-debug.log npm<br \/>\nnpm ERR!<br \/>\nnpm ERR! System Linux 3.2.0-53-generic<br \/>\nnpm ERR! command &#8220;node&#8221; &#8220;\/usr\/bin\/npm&#8221; &#8220;install&#8221; &#8220;-g&#8221; &#8220;grunt-cli&#8221;<br \/>\nnpm ERR! cwd \/home\/scmbuild<br \/>\nnpm ERR! node -v v0.6.12<br \/>\nnpm ERR! npm -v 1.1.4<br \/>\nnpm ERR! message No compatible version found: grunt-cli<br \/>\nnpm ERR! message No valid targets found.<br \/>\nnpm ERR! message Perhaps not compatible with your version of node?<br \/>\nnpm ERR!<br \/>\nnpm ERR! Additional logging details can be found in:<br \/>\nnpm ERR! \/home\/scmbuild\/npm-debug.log<br \/>\nnpm not ok<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>rajeshkumar replied the topic: Fatal error: Unable to find local grunt.<\/strong><br \/>\nSeems like node is older version so need to user latest&#8230;<br \/>\nHow to upgrade nodes in Ubantu<br \/>\nInstall the dependencies:<\/p>\n<p>sudo apt-get install g++ curl libssl-dev apache2-utils<br \/>\nsudo apt-get install git-core<\/p>\n<p>Run the following commands:<\/p>\n<p>git clone git:\/\/github.com\/ry\/node.git<br \/>\ncd node<br \/>\n.\/configure<br \/>\nmake<br \/>\nsudo make install<\/p>\n<p>How to install grunt<br \/>\nHere&#8217;s what I did to fix this:<\/p>\n<p>Uninstalled grunt globally:<\/p>\n<p>npm uninstall -g grunt<\/p>\n<p>Installed grunt-cli globally:<\/p>\n<p>npm install -g grunt-cli<\/p>\n<p>Then, in project root dir:<\/p>\n<p>npm install<\/p>\n<p>And all is good. Hope this works for anyone else running into this.<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>rajeshkumar replied the topic: Fatal error: Unable to find local grunt.<\/strong><br \/>\nAfter running latest nodes, while using folliowing commands i got following error&#8230;&#8221;npm install -g grunt-cli&#8221;<\/p>\n<p>module.js:333<br \/>\nthrow err;<br \/>\n^<br \/>\nError: Cannot find module &#8216;graceful-fs&#8217;<br \/>\nat Function.Module._resolveFilename (module.js:331:15)<br \/>\nat Function.Module._load (module.js:273:25)<br \/>\nat Module.require (module.js:357:17)<br \/>\nat require (module.js:373:17)<br \/>\nat Object.<anonymous> (\/usr\/share\/npm\/lib\/utils\/ini.js:32:10)<br \/>\nat Module._compile (module.js:449:26)<br \/>\nat Object.Module._extensions..js (module.js:467:10)<br \/>\nat Module.load (module.js:349:32)<br \/>\nat Function.Module._load (module.js:305:12)<br \/>\nat Module.require (module.js:357:17)<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n<p><strong>rajeshkumar replied the topic: Fatal error: Unable to find local grunt.<\/strong><br \/>\nFrom in stacekoverlfow..<\/p>\n<p>Don&#8217;t download npm from aptitude or apt-get. Instead try:<\/p>\n<p>git clone git:\/\/github.com\/isaacs\/npm.git<br \/>\ncd npm\/scripts<br \/>\nchmod +x install.sh<br \/>\nsudo .\/install.sh<\/p>\n<p>saw it here: NPM can&#8217;t install appjs. Error: Cannot find module &#8216;graceful-fs&#8217;<\/p>\n<p>or<\/p>\n<p>sudo npm install<\/p>\n<p>or<\/p>\n<p>sudo apt-get remove npm<br \/>\nsudo apt-get install npm<br \/>\nRegards,<br \/>\nRajesh Kumar<br \/>\nTwitt me @ <a href=\"http:\/\/twitter.com\/RajeshKumarIn\" target=\"_blank\" rel=\"noopener\">twitter.com\/RajeshKumarIn<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>scmuser created the topic: Fatal error: Unable to find local grunt. I am getting following error&#8230; grunt lite grunt-cli: The grunt command line interface. (v0.1.9) Fatal error: Unable to find&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[129],"class_list":["post-2160","post","type-post","status-publish","format-standard","hentry","category-uncategorised","tag-grunt"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2160","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=2160"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2160\/revisions"}],"predecessor-version":[{"id":2161,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/2160\/revisions\/2161"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=2160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=2160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=2160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}