警告:拼合不是函数-使用--force继续

问题描述 投票:0回答:1

我对咕unt声有一个很奇怪的错误。在我们的CI系统中经过一段时间后,由于某种原因,此任务开始失败。可能有人遇到相同的问题?

当我运行grunt assemble:site时,它输出:

Running "assemble:site" (assemble) task
Warning: flatten is not a function Use --force to continue.

如何解决此错误?任务中一些配置问题?

Gruntfile.js组装任务部分

module.exports = function(grunt) {
    grunt.initConfig({

        //other tasks
        assemble: {
            options: {
                production: true,
                ext: '.html',
                data: 'src/data/*.json',
                assets: 'dist/assets',
                helpers: 'src/helpers/*-helper.js',
                layoutdir: 'src/templates/layouts',
                partials: ['src/templates/partials/*.hbs']
            },
            site: {
                options: {
                    layout: 'default.hbs'
                },
                files: [{
                    expand: true,
                    cwd: 'src/templates/pages',
                    src: ['*.hbs'],
                    dest: 'dist/'
                }]
            }
        },

        //other tasks

    });

    //other loadNpmTasks

    grunt.loadNpmTasks('grunt-assemble');

    //other registerTask

    grunt.registerTask('build', [
        'concat:bootstrap',
        'concat:js',
        'uglify:js',
        'copy:js',
        'assemble',
        'prettify',
        'sprite',
        'svgmin',
        'sass',
        'postcss',
        'copy:gfx',
        'pngmin'
    ]);
}

Package.json文件:

{
  "name": "html-prototype",
  "version": "1.0.0",
  "description": "HTML prototype",
  "devDependencies": {
    "autoprefixer": "^6.7.2",
    "grunt": "^1.0.0",
    "grunt-assemble": "^0.6.3",
    "grunt-autoprefixer": "^3.0.4",
    "grunt-contrib-concat": "^1.0.1",
    "grunt-contrib-copy": "^1.0.0",
    "grunt-contrib-uglify": "^2.0.0",
    "grunt-contrib-watch": "^1.0.0",
    "grunt-newer": "^1.1.0",
    "grunt-pngmin": "^1.0.2",
    "grunt-postcss": "^0.8.0",
    "grunt-prettify": "0.4.0",
    "grunt-sass": "^2.0.0",
    "grunt-string-replace": "^1.3.1",
    "grunt-svg-sprite": "1.4.0",
    "grunt-svgmin": "^4.0.0",
    "node-sass": "~4.5.0",
    "postcss-placehold": "^1.2.0",
    "postcss-svg": "^1.0.6",
    "svg-sprite": "1.4.0"
  },
  "dependencies": {
    "digits": "~0.2.0"
  },
  "scripts": {
    "grunt-build": "grunt build"
  }
}
javascript node.js npm gruntjs
1个回答
0
投票

这里包本身有问题。 More info here

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.