Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting grunt error on sails lift

I am getting this error on sails lift.

Sails version : v0.10.0-rc11

error: Grunt :: module.js:340
    throw err;
          ^
Error: Cannot find module '/home/mandeep/freelance/hellos/node_modules/sails/node_modules/grunt-cli/bin/grunt'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
info: 

I have tried uninstalling grunt globally and then re-installing but its not working

like image 221
Mandeep Singh Avatar asked Aug 22 '14 18:08

Mandeep Singh


2 Answers

The accepted answer did not work for me; uninstalling, clearing the cache, and reinstalling did not force sails to add the necessary dependency to its node_modules (I think because I have grunt-cli installed globally). Instead I had to go into my_project_directory/node_modules/sails and run npm install grunt-cli

See https://github.com/balderdashy/sails/issues/2059 for more explanation and hopefully some feedback or a bugfix from the sails team.

like image 167
leejt489 Avatar answered Nov 14 '22 08:11

leejt489


Looks like something got corrupted in your Sails install. In your project directory do:

npm uninstall sails
npm cache clear
npm install sails

That should fix it. A more scorched-earth approach would be:

rm -rf node_modules
npm cache clear
npm install

To make sure all of your dependencies are up to date.

like image 40
sgress454 Avatar answered Nov 14 '22 06:11

sgress454