服务器挂在跑步与QUOT;并发:服务器" (并发)任务 [英] Server hangs on Running "concurrent:server" (concurrent) task

查看:284
本文介绍了服务器挂在跑步与QUOT;并发:服务器" (并发)任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我输入'咕噜服务'在命令行中的服务器挂起在运行并发:服务器(并发)任务,我不得到服务器即将结束,因为任何erros.The imagemin.js错误的过程中的任何消息犯规SEM是停止服务器

 加载imagemin.js任务...错误
>>错误:无法找到模块imagemin-gifsicle运行服务的任务运行干净:服务器(清洁)任务运行wiredep:应用程序(wiredep)任务运行wiredep:上海社会科学院(wiredep)任务运行并发:服务器(并发)任务

下面是我gruntfile的内容

  //使用发电机角度0.9.2在2014年8月9日产生
使用严格的;//#通配符
//由于性能原因我们只匹配向下一个级别:
//'测试/规格/ {* /} *。JS
//如果你想递归匹配所有子文件夹使用:
//'测试/规格/ ** / *。JSmodule.exports =功能(呼噜声){  //加载咕噜自动任务
  需要('负载咕噜任务)(呼噜声);  //长时间的任务怎么拿。可以帮助在优化构建时间
  需要('时间咕噜')(呼噜声);  为应用程序//配置路径
  VAR的AppConfig = {
    应用:要求('./ bower.json')|| APPPATH。 应用程序,
    距:'DIST'
  };  //定义配置的所有任务
  grunt.initConfig({    //项目设置
    自耕农:AppConfig中,    //手表文件的变化,并根据修改过的文件运行任务
    手表:{
      亭子:{
        文件:['bower.json'],
        任务:['wiredep']
      },
      JS:{
        文件:['<%= yeoman.app%GT; /脚本/ {* /} * JS'],
        任务:['更新:jshint:所有'],
        选项​​:{
          livereload:'<%= connect.options.livereload%GT;'
        }
      },
      jsTest:{
        文件:['。测试/规格/ {* /} * JS'],
        任务:['更新:jshint:测试','因果报应']
      },
      指南针:{
        文件:['<%= yeoman.app%GT; /风格/ {* /} * {SCSS,上海社会科学院}'],
        任务:['指南针:服务器','汽车prefixer']
      },
      gruntfile:{
        文件:['Gruntfile.js']
      },
      livereload:{
        选项​​:{
          livereload:'<%= connect.options.livereload%GT;'
        },
        文件:
          '<%= yeoman.app%GT; / {* /} * HTML。,
          .TMP /风格/ {* /} *。CSS,
          '<%= yeoman.app%方式> /图像/ {* /} * {PNG,JPG,JPEG,GIF,WEBP,SVG}
        ]
      }
    },    //实际咕噜服务器设置
    连接:{
      选项​​:{
        端口:9000,
        //更改为0.0.0.0从外部访问该服务器。
        主机名:'localhost'的,
        livereload:35729
      },
      livereload:{
        选项​​:{
          打开:真实,
          中间件:功能(连接){
            返回[
              connect.static('。tmp目录),
              连接()。使用(
                '/ bower_components',
                connect.static('./ bower_components')
              )
              connect.static(appConfig.app)
            ];
          }
        }
      },
      测试:{
        选项​​:{
          端口:9001,
          中间件:功能(连接){
            返回[
              connect.static('。tmp目录),
              connect.static(测试),
              连接()。使用(
                '/ bower_components',
                connect.static('./ bower_components')
              )
              connect.static(appConfig.app)
            ];
          }
        }
      },
      距:{
        选项​​:{
          打开:真实,
          基地:'<%= yeoman.dist%GT;'
        }
      }
    },    //确保code风格都达到标准,并没有出现明显的失误
    jshint:{
      选项​​:{
        jshintrc:.jshintrc',
        记者:需要('jshint-时尚')
      },
      所有:{
        SRC:
          Gruntfile.js',
          '&所述;%= yeoman.app%方式> /脚本/ {* /} * JS'
        ]
      },
      测试:{
        选项​​:{
          jshintrc:测试/ .jshintrc
        },
        SRC:['测试/规格/ {* /} * JS。']
      }
    },    //清空文件夹重新开始
    清洁:{
      距:{
        文件:[{
          点:真实,
          SRC:
            .TMP,
            '&所述;%= yeoman.dist%GT / {* /} *',
            '!&下;%= yeoman.dist%方式> / GIT中*'
          ]
        }]
      },
      服务器:'的.tmp
    },    //添加厂商prefixed风格
    汽车prefixer:{
      选项​​:{
        浏览器:['最后1版']
      },
      距:{
        文件:[{
          拓展:真实,
          CWD:.TMP /风格/',
          SRC:'{* /} * CSS,
          DEST:.TMP /风格/
        }]
      }
    },    //自动注入鲍尔组件到应用程序
    wiredep:{
      选项​​:{
        CWD:'<%= yeoman.app%GT;'
      },
      应用:{
        的src:['&下;%= yeoman.app%GT; /index.html'],
        ignorePath:/\\.\\.\\//
      },
      上海社会科学院:{
        SRC:['<%= yeoman.app%GT; /风格/ {* /} * {SCSS,上海社会科学院}'],
        ignorePath:/(\\.\\.\\/){1,2}bower_components\\//
      }
    },    //编译萨斯到CSS,如果要求生成必要的文件
    指南针:{
      选项​​:{
        sassDir:'<%= yeoman.app%GT; /风格',
        cssDir:.TMP /风格',
        generatedImagesDir:.TMP /图像/生成,
        imagesDir:'<%= yeoman.app%GT; /图像,
        javascriptsDir:'<%= yeoman.app%GT; /脚本,
        fontsDir:'<%= yeoman.app%GT; /风格/字体,
        importPath:./bower_components',
        httpImagesPath:/图像,
        httpGeneratedImagesPath:'/图像/生成,
        httpFontsPath:'/风格/字体,
        relativeAssets:假的,
        assetCacheBuster:假的,
        原料:'萨斯::脚本::数precision = 10 \\ N'
      },
      距:{
        选项​​:{
          generatedImagesDir:'<%= yeoman.dist%GT; /图像/生成
        }
      },
      服务器:{
        选项​​:{
          debuginfo软:真
        }
      }
    },    //重命名为浏览器缓存文件的目的
    filerev:{
      距:{
        SRC:
          '<%= yeoman.dist%GT; /脚本/ {* /} * JS。,
          '<%= yeoman.dist%GT; /风格/ {* /} * CSS。​​,
          '<%= yeoman.dist%方式> /图像/ {* /} * {PNG,JPG,JPEG,GIF,WEBP,SVG}
          '<%= yeoman.dist%GT; /风格/字体/ *
        ]
      }
    },    //读取HTML的usemin块启用智能的自动生成
    // CONCAT,缩小和修订文件。在内存中创建的配置,从而
    //其他任务可以对它们进行操作
    usemin prepare:{
      HTML:'<%= yeoman.app%GT; /index.html',
      选项​​:{
        DEST:'<%= yeoman.dist%GT;,
        流: {
          HTML:{
            脚步: {
              JS:['CONCAT','uglifyjs'],
              CSS:['cssmin']
            },
            岗位:{}
          }
        }
      }
    },    //执行基于filerev和usemin prepare配置重写
    usemin:{
      HTML:['<%= yeoman.dist%GT; / {* /} * HTML'],
      CSS:['<%= yeoman.dist%GT; /风格/ {* /} * CSS'],
      选项​​:{
        assetsDirs:['&下;%= yeoman.dist%GT;','&下;%= yeoman.dist%GT /图像']
      }
    },    //下面* -min任务将产生dist文件夹minified的文件
    //默认情况下,你的`index.html`的<! - Usemin块 - >会照顾
    //缩小。这些选项旁边是pre-配置,如果你不希望
    //使用Usemin块。
    // cssmin:{
    // DIST:{
    //文件:{
    //'<%= yeoman.dist%GT; /styles/main.css':[
    //'的.tmp /风格/ {* /} *。CSS
    //]
    //}
    //}
    //},
    //丑化:{
    // DIST:{
    //文件:{
    //'<%= yeoman.dist%GT; /scripts/scripts.js':[
    //'<%= yeoman.dist%GT; /scripts/scripts.js
    //]
    //}
    //}
    //},
    // CONCAT:{
    // DIST:{}
    //},    imagemin:{
      距:{
        文件:[{
          拓展:真实,
          CWD:'<%= yeoman.app%GT; /图像,
          SRC:'{* /} * {PNG,JPG,JPEG,GIF}
          DEST:'<%= yeoman.dist%GT; /图像
        }]
      }
    },    svgmin:{
      距:{
        文件:[{
          拓展:真实,
          CWD:'<%= yeoman.app%GT; /图像,
          SRC:'{* /} * SVG',
          DEST:'<%= yeoman.dist%GT; /图像
        }]
      }
    },    htmlmin:{
      距:{
        选项​​:{
          collapseWhitespace:真实,
          conservativeCollapse:真实,
          collapseBooleanAttributes:真实,
          removeCommentsFromCDATA:真实,
          removeOptionalTags:真
        },
        文件:[{
          拓展:真实,
          CWD:'<%= yeoman.dist%GT;,
          SRC:'意见/ {* /} * HTML''*。html的'],
          DEST:'<%= yeoman.dist%GT;'
        }]
      }
    },    // ngmin通过试图使code为安全自动缩小
    //使用角长格式依赖注入。它不工作的
    //之类的东西解决或注入所以这些必须手动完成。
    ngmin:{
      距:{
        文件:[{
          拓展:真实,
          CWD:.TMP / CONCAT /脚本,
          SRC:'* .js文件',
          DEST:.TMP / CONCAT /脚本
        }]
      }
    },    //取代谷歌CDN引用
    cdnify:{
      距:{
        HTML:['<%= yeoman.dist%GT; / * HTML。]
      }
    },    //剩余复制文件到地方其他任务可以使用
    复制:{
      距:{
        文件:[{
          拓展:真实,
          点:真实,
          CWD:'<%= yeoman.app%GT;,
          DEST:'<%= yeoman.dist%GT;,
          SRC:
            * {ICO等,PNG,TXT}
            '的.htaccess',
            *。html的',
            意见/ {* /} * HTML,
            图像/ {* /} * {} WEBP,
            字体/ *
          ]
        },{
          拓展:真实,
          CWD:.TMP /图像,
          DEST:'<%= yeoman.dist%GT; /图像,
          SRC:['生成/ *]
        },{
          拓展:真实,
          CWD:,'。'
          SRC:bower_components /引导-萨斯官方/供应商/资产/字体/引导/ *',
          DEST:'<%= yeoman.dist%GT;'
        }]
      },
      款式:{
        拓展:真实,
        CWD:'<%= yeoman.app%GT; /风格',
        DEST:.TMP /风格/',
        SRC:'{* /} * CSS
      }
    },    //并行运行某些任务,加快构建过程
    同时: {
      服务器:
        指南针:服务器
      ]
      测试:
        '罗盘'
      ]
      DIST:
        指南针:DIST',
        imagemin',
        svgmin
      ]
    },    //测试设置
    因果报应:{
      单位:{
        CONFIGFILE:测试/ karma.conf.js',
        singleRun:真
      }
    }
  });
  grunt.registerTask('全心全意','编译然后启动一个连接web服务器,功能(目标){
    如果(目标==='DIST'){
      返回grunt.task.run(['建设','连接:DIST:保活']);
    }    grunt.task.run([
      干净:服务器',
      wiredep',
      并发:服务器',
      自动prefixer',
      连接:livereload',
      '看'
    ]);
  });  grunt.registerTask(服务器,DE preCATED任务。使用服务,而不是任务',函数(目标){
    grunt.log.warn('了`server`任务已经pcated德$ P $使用`咕噜serve`启动服务器。');
    grunt.task.run(['服务:'+目标]);
  });  grunt.registerTask(测试,[
    干净:服务器',
    并发:测试',
    自动prefixer',
    连接:测试',
    业力
  ]);  grunt.registerTask('打造',[
    干净:DIST',
    wiredep',
    usemin prepare',
    并发:DIST',
    自动prefixer',
    CONCAT,
    ngmin',
    '复制:DIST',
    cdnify',
    cssmin',
    '丑化',
    filerev',
    usemin',
    htmlmin
  ]);  grunt.registerTask(默认,[
    更新:jshint',
    '测试',
    '建立'
  ]);
};


解决方案

有竟是我的机器上的指南针和罗盘轨之间的冲突,当我卸载使用命令'宝石卸载指南针护栏指南针护栏冲突了客场和应用程序开始重新运行

When i type 'grunt serve' in the command line the server hangs at Running "concurrent:server" (concurrent) task and i dont get any message that server is ending the process because of any erros.The imagemin.js error doesnt sem to be stopping the server

Loading "imagemin.js" tasks...ERROR
>> Error: Cannot find module 'imagemin-gifsicle'

Running "serve" task

Running "clean:server" (clean) task

Running "wiredep:app" (wiredep) task

Running "wiredep:sass" (wiredep) task

Running "concurrent:server" (concurrent) task

Here are the contents of my gruntfile

// Generated on 2014-08-09 using generator-angular 0.9.2
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  // Load grunt tasks automatically
  require('load-grunt-tasks')(grunt);

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Configurable paths for the application
  var appConfig = {
    app: require('./bower.json').appPath || 'app',
    dist: 'dist'
  };



  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: appConfig,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'karma']
      },
      compass: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'autoprefixer']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: 9000,
        // Change this to '0.0.0.0' to access the server from outside.
        hostname: 'localhost',
        livereload: 35729
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      test: {
        options: {
          port: 9001,
          middleware: function (connect) {
            return [
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      dist: {
        options: {
          open: true,
          base: '<%= yeoman.dist %>'
        }
      }
    },

    // Make sure code styles are up to par and there are no obvious mistakes
    jshint: {
      options: {
        jshintrc: '.jshintrc',
        reporter: require('jshint-stylish')
      },
      all: {
        src: [
          'Gruntfile.js',
          '<%= yeoman.app %>/scripts/{,*/}*.js'
        ]
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/spec/{,*/}*.js']
      }
    },

    // Empties folders to start fresh
    clean: {
      dist: {
        files: [{
          dot: true,
          src: [
            '.tmp',
            '<%= yeoman.dist %>/{,*/}*',
            '!<%= yeoman.dist %>/.git*'
          ]
        }]
      },
      server: '.tmp'
    },

    // Add vendor prefixed styles
    autoprefixer: {
      options: {
        browsers: ['last 1 version']
      },
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/styles/',
          src: '{,*/}*.css',
          dest: '.tmp/styles/'
        }]
      }
    },

    // Automatically inject Bower components into the app
    wiredep: {
      options: {
        cwd: '<%= yeoman.app %>'
      },
      app: {
        src: ['<%= yeoman.app %>/index.html'],
        ignorePath:  /\.\.\//
      },
      sass: {
        src: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        ignorePath: /(\.\.\/){1,2}bower_components\//
      }
    },

    // Compiles Sass to CSS and generates necessary files if requested
    compass: {
      options: {
        sassDir: '<%= yeoman.app %>/styles',
        cssDir: '.tmp/styles',
        generatedImagesDir: '.tmp/images/generated',
        imagesDir: '<%= yeoman.app %>/images',
        javascriptsDir: '<%= yeoman.app %>/scripts',
        fontsDir: '<%= yeoman.app %>/styles/fonts',
        importPath: './bower_components',
        httpImagesPath: '/images',
        httpGeneratedImagesPath: '/images/generated',
        httpFontsPath: '/styles/fonts',
        relativeAssets: false,
        assetCacheBuster: false,
        raw: 'Sass::Script::Number.precision = 10\n'
      },
      dist: {
        options: {
          generatedImagesDir: '<%= yeoman.dist %>/images/generated'
        }
      },
      server: {
        options: {
          debugInfo: true
        }
      }
    },

    // Renames files for browser caching purposes
    filerev: {
      dist: {
        src: [
          '<%= yeoman.dist %>/scripts/{,*/}*.js',
          '<%= yeoman.dist %>/styles/{,*/}*.css',
          '<%= yeoman.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
          '<%= yeoman.dist %>/styles/fonts/*'
        ]
      }
    },

    // Reads HTML for usemin blocks to enable smart builds that automatically
    // concat, minify and revision files. Creates configurations in memory so
    // additional tasks can operate on them
    useminPrepare: {
      html: '<%= yeoman.app %>/index.html',
      options: {
        dest: '<%= yeoman.dist %>',
        flow: {
          html: {
            steps: {
              js: ['concat', 'uglifyjs'],
              css: ['cssmin']
            },
            post: {}
          }
        }
      }
    },

    // Performs rewrites based on filerev and the useminPrepare configuration
    usemin: {
      html: ['<%= yeoman.dist %>/{,*/}*.html'],
      css: ['<%= yeoman.dist %>/styles/{,*/}*.css'],
      options: {
        assetsDirs: ['<%= yeoman.dist %>','<%= yeoman.dist %>/images']
      }
    },

    // The following *-min tasks will produce minified files in the dist folder
    // By default, your `index.html`'s <!-- Usemin block --> will take care of
    // minification. These next options are pre-configured if you do not wish
    // to use the Usemin blocks.
    // cssmin: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/styles/main.css': [
    //         '.tmp/styles/{,*/}*.css'
    //       ]
    //     }
    //   }
    // },
    // uglify: {
    //   dist: {
    //     files: {
    //       '<%= yeoman.dist %>/scripts/scripts.js': [
    //         '<%= yeoman.dist %>/scripts/scripts.js'
    //       ]
    //     }
    //   }
    // },
    // concat: {
    //   dist: {}
    // },

    imagemin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.{png,jpg,jpeg,gif}',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    svgmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '<%= yeoman.app %>/images',
          src: '{,*/}*.svg',
          dest: '<%= yeoman.dist %>/images'
        }]
      }
    },

    htmlmin: {
      dist: {
        options: {
          collapseWhitespace: true,
          conservativeCollapse: true,
          collapseBooleanAttributes: true,
          removeCommentsFromCDATA: true,
          removeOptionalTags: true
        },
        files: [{
          expand: true,
          cwd: '<%= yeoman.dist %>',
          src: ['*.html', 'views/{,*/}*.html'],
          dest: '<%= yeoman.dist %>'
        }]
      }
    },

    // ngmin tries to make the code safe for minification automatically by
    // using the Angular long form for dependency injection. It doesn't work on
    // things like resolve or inject so those have to be done manually.
    ngmin: {
      dist: {
        files: [{
          expand: true,
          cwd: '.tmp/concat/scripts',
          src: '*.js',
          dest: '.tmp/concat/scripts'
        }]
      }
    },

    // Replace Google CDN references
    cdnify: {
      dist: {
        html: ['<%= yeoman.dist %>/*.html']
      }
    },

    // Copies remaining files to places other tasks can use
    copy: {
      dist: {
        files: [{
          expand: true,
          dot: true,
          cwd: '<%= yeoman.app %>',
          dest: '<%= yeoman.dist %>',
          src: [
            '*.{ico,png,txt}',
            '.htaccess',
            '*.html',
            'views/{,*/}*.html',
            'images/{,*/}*.{webp}',
            'fonts/*'
          ]
        }, {
          expand: true,
          cwd: '.tmp/images',
          dest: '<%= yeoman.dist %>/images',
          src: ['generated/*']
        }, {
          expand: true,
          cwd: '.',
          src: 'bower_components/bootstrap-sass-official/vendor/assets/fonts/bootstrap/*',
          dest: '<%= yeoman.dist %>'
        }]
      },
      styles: {
        expand: true,
        cwd: '<%= yeoman.app %>/styles',
        dest: '.tmp/styles/',
        src: '{,*/}*.css'
      }
    },

    // Run some tasks in parallel to speed up the build process
    concurrent: {
      server: [
        'compass:server'
      ],
      test: [
        'compass'
      ],
      dist: [
        'compass:dist',
        'imagemin',
        'svgmin'
      ]
    },

    // Test settings
    karma: {
      unit: {
        configFile: 'test/karma.conf.js',
        singleRun: true
      }
    }
  });


  grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
    if (target === 'dist') {
      return grunt.task.run(['build', 'connect:dist:keepalive']);
    }

    grunt.task.run([
      'clean:server',
      'wiredep',
      'concurrent:server',
      'autoprefixer',
      'connect:livereload',
      'watch'
    ]);
  });

  grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve:' + target]);
  });

  grunt.registerTask('test', [
    'clean:server',
    'concurrent:test',
    'autoprefixer',
    'connect:test',
    'karma'
  ]);

  grunt.registerTask('build', [
    'clean:dist',
    'wiredep',
    'useminPrepare',
    'concurrent:dist',
    'autoprefixer',
    'concat',
    'ngmin',
    'copy:dist',
    'cdnify',
    'cssmin',
    'uglify',
    'filerev',
    'usemin',
    'htmlmin'
  ]);

  grunt.registerTask('default', [
    'newer:jshint',
    'test',
    'build'
  ]);
};

解决方案

There was actually a conflict between compass and compass-rails on my machine and when i uninstalled compass-rails using command 'gem uninstall compass-rails' the conflict went away and the app started running again

这篇关于服务器挂在跑步与QUOT;并发:服务器&QUOT; (并发)任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆