Getting grunt error on sails lift

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-02 03:33:04

问题


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


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/25453807/getting-grunt-error-on-sails-lift

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!