【问题标题】:Getting grunt error on sails lift在帆升降机上出现咕噜声
【发布时间】:2014-10-16 17:00:24
【问题描述】:

我在升帆时收到此错误。

帆版: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: 

我已尝试全局卸载 grunt,然后重新安装,但它不起作用

【问题讨论】:

    标签: gruntjs sails.js


    【解决方案1】:

    接受的答案对我不起作用;卸载、清除缓存和重新安装并没有强制sails 为其node_modules 添加必要的依赖项(我认为是因为我已经全局安装了grunt-cli)。相反,我必须进入 my_project_directory/node_modules/sails 并运行 npm install grunt-cli

    请参阅 https://github.com/balderdashy/sails/issues/2059 了解更多解释,并希望获得来自 Sails 团队的反馈或错误修复。

    【讨论】:

    • grunt-cli 的全局安装不会导致任何问题。在上述方法不起作用的情况下,我再次遇到了这个问题。然后我不得不从我的 package.json 中删除 grunt-cli,然后删除所有 npm 包并重新安装。然后它工作了
    【解决方案2】:

    您的 Sails 安装中似乎有一些东西损坏了。在您的项目目录中执行:

    npm uninstall sails
    npm cache clear
    npm install sails
    

    这应该可以解决它。更焦土的方法是:

    rm -rf node_modules
    npm cache clear
    npm install
    

    确保所有依赖项都是最新的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-11
      • 2014-02-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-12-18
      • 2018-04-18
      相关资源
      最近更新 更多