2014-10-30 60 views
0

所以我一直在使用Grunt来编译我的少文件(除其他外),它工作正常,我的gruntfile.js设置正确,但突然我的终端是现在说Grunt突然找不到目录

Running "less:components" (less) task 
Warning: Cannot find module '/Users/../path/to/directory/../less' Use --force to continue. 

少目录绝对是它应该是,所以我不明白为什么这可能会发生。有什么建议吗?

编辑:的npm list结果显示了一个长长的名单看起来不错,但在最后

npm ERR! extraneous: [email protected] /Users/../path/../node_modules/grunt-cli 
npm ERR! missing: [email protected]~2.0.0, required by [email protected] 
npm ERR! missing: [email protected]^0.3.3, required by [email protected] 
npm ERR! missing: [email protected]^0.3.3, required by [email protected] 
npm ERR! not ok code 0 

在Gruntfile.js的减配置看起来像这样

less: { 
     components: { 
     files: {   
      'compiled_css/login.css': ['less/login.less'], 
      'compiled_css/front.css': ['less/_import.less']   
     } 
     }, 
     options: { 
     expand: true, 
     paths: [ 
     'bower_components/bootstrap/less', 
     'less' 
     ] 
     } 
    }, 
+0

它说'找不到模块'。发布'npm list'的输出(如果结果太长,则压缩结果)以及您的配置较少的任务。 – 2014-10-30 13:04:16

+0

我编辑了原始问题。 – 2014-10-30 13:19:20

回答

0
没有给这个错误

好的,我设法解决了这个问题。我从根中删除了node_modules目录并再次运行npm install

然后运行grun吨,它一切正常。