Getting a grunt error while sailing

I get this error when sailing.

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 tried to uninstall grunt globally and then reinstall, but its not working

+6
source share
2 answers

Something seems to be messed up in your Sails installation. In the project directory, do:

 npm uninstall sails npm cache clear npm install sails 

That should fix it. A more approximate approach:

 rm -rf node_modules npm cache clear npm install 

To make sure all your dependencies are updated.

+5
source

The accepted answer did not work for me; deleting, clearing the cache and reinstalling did not force the 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 a more detailed explanation and hopefully some feedback or correction from the sail team.

+9
source

Source: https://habr.com/ru/post/974231/


All Articles