执行grunt任务时出现grunt错误

时间:2015-01-23 15:19:17

标签: javascript angularjs backbone.js gruntjs grunt-concurrent

  1. 你能告诉我为什么我会收到咕噜咕噜的错误。
  2. 为grunt错误添加屏幕截图...
  3. 在下面提供我的咕噜声代码......
  4. 在我的代码中我使用了以下代码..
  5. 我收到这样的警告有比你更多的任务 并发限制。达到此限制后,将无法执行其他任务 运行直到当前的指令完成。你可以调整限制 当前任务选项

    module.exports = {     服务器:[         ' SASS&#39 ;,         '拷贝:服务器&#39 ;,         '鲍尔:安装'     ]     dist:[         ' SASS&#39 ;,         ' imagemin&#39 ;,         ' htmlmin'     ] };

  6. 这是来自节点模块

    'use strict';
    var lpad = require('lpad');
    var async = require('async');
    var cpCache = [];
    
    module.exports = function (grunt) {
        grunt.registerMultiTask('concurrent', 'Run grunt tasks concurrently', function () {
            var spawnOptions;
            var cb = this.async();
            var options = this.options({
                limit: Math.max(require('os').cpus().length, 2)
            });
            // Set the tasks based on the config format
            var tasks = this.data.tasks || this.data;
    
            // Warning if there are too many tasks to execute within the given limit
            if (options.limit < tasks.length) {
                grunt.log.oklns(
                    'Warning: There are more tasks than your concurrency limit. After ' +
                    'this limit is reached no further tasks will be run until the ' +
                    'current tasks are completed. You can adjust the limit in the ' + 
                    'concurrent task options'
                );
            }
    
            // Optionally log the task output
            if (options.logConcurrentOutput) {
                spawnOptions = { stdio: 'inherit' };
            }
    
            lpad.stdout('    ');
            async.eachLimit(tasks, options.limit, function (task, next) {
                var cp = grunt.util.spawn({
                    grunt: true,
                    args: [task].concat(grunt.option.flags()),
                    opts: spawnOptions
                }, function (err, result, code) {
                    if (err || code > 0) {
                        grunt.warn(result.stderr || result.stdout);
                    }
                    grunt.log.writeln('\n' + result.stdout);
                    next();
                });
    
                cpCache.push(cp);
            }, function () {
                lpad.stdout();
                cb();
            });
        });
    };
    
    // make sure all child processes are killed when grunt exits
    process.on('exit', function () {
        cpCache.forEach(function (el) {
            el.kill();
        });
    });
    

0 个答案:

没有答案