2016-01-04 45 views
0

我有下Gruntfile.js咕嚕手錶失敗消息 「運行 」監視「 任務等待...警告:最大調用堆棧大小超出」

module.exports = function(grunt) { 
 
    
 
    'use strict'; 
 

 
    // Load Grunt tasks declared in the package.json file 
 
    require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); 
 

 
    // Configure Grunt 
 
    grunt.initConfig({ 
 

 
     // Grunt express - our webserver 
 
     // https://github.com/blai/grunt-express 
 
     express: { 
 
      all: { 
 
       options: { 
 
        bases: 'xxxxxxxx', 
 
        port: 9000, 
 
        hostname: '0.0.0.0', 
 
        livereload: true 
 
       } 
 
      } 
 
     }, 
 

 
     // grunt-watch will monitor the projects files 
 
     // https://github.com/gruntjs/grunt-contrib-watch 
 
     watch: { 
 
      all: { 
 
        files: ['**/*.html'], 
 
        options: { 
 
         livereload: true 
 
       } 
 
      } 
 
     }, 
 

 
     // grunt-open will open your browser at the project's URL 
 
     // https://www.npmjs.org/package/grunt-open 
 
     open: { 
 
      all: { 
 
       path: 'http://localhost:9000/index.html' 
 
      } 
 
     }, 
 

 
     // grunt-open will install the bower components defined on the bower.json file 
 
     // https://www.npmjs.com/package/grunt-bower-install-simple 
 
     'bower-install-simple': { 
 
      options: { 
 
       color: true, 
 
       directory: 'assets/bower_components' 
 
      }, 
 
      'prod': { 
 
       options: { 
 
        production: true 
 
       } 
 
      }, 
 
      'dev': { 
 
       options: { 
 
        production: false 
 
       } 
 
      } 
 
     } 
 
    }); 
 

 
    // Creates the `server` task 
 
    grunt.registerTask('server', [ 
 
     'express', 
 
     'open', 
 
     'watch' 
 
     ]); 
 
};

{ 
 
    "engines": { 
 
    "node": ">= 0.10.0" 
 
    }, 
 
    "devDependencies": { 
 
    "grunt-bower-install-simple": "~1.2.0", 
 
    "grunt-contrib-watch": "~0.6.1", 
 
    "grunt": "~0.4.5", 
 
    "matchdep": "~1.0.0", 
 
    "grunt-express": "~1.4.1", 
 
    "grunt-open": "~0.2.3" 
 
    } 
 
}

我嘗試解決方案:Grunt watch error - Waiting...Fatal error: watch ENOSPC

但我仍然有這樣的錯誤:

Running "watch" task Waiting... Warning: Maximum call stack size exceeded

這兒還有沒有人知道我在做什麼錯?

謝謝!

+0

哪咕嚕任務,你運行以獲取錯誤?你還有其他你編輯出來的任務嗎?或者這真的是你的完整gruntfile? –

+0

我正在運行grunt服務器,這是完整的gruntfile,謝謝 –

+0

好的 - 你還可以發佈你的package.json嗎? –

回答

1

grunt-express的文檔看來,設置livereload會生成一個監視任務。我相信這個任務與您自己的watch任務衝突。

嘗試刪除你的手錶配置和修改您的服務器任務,以保持服務器活着:

// Creates the `server` task 
grunt.registerTask('server', [ 
    'express', 
    'open', 
    'express-keepalive' 
    ]); 
+0

非常感謝你,這個修復任務! –

相關問題