2

初めて grunt.js を試していますが、初心者の問題がいくつかあります。

/foundation/ フォルダー内のすべての js ファイルを連結したい

次のエラーが表示されます。

Running "concat:options" (concat) task

TypeError: Cannot read property 'linefeed' of undefined
at Object.module.exports (....file path here...../_compass/javascripts/node_modules/grunt-contrib-concat/tasks/concat.js:19:28)
at Object.task.registerMultiTask.thisTask (/usr/local/lib/node_modules/grunt/lib/grunt/task.js:109:15)
at Object.task.registerTask.thisTask.fn (/usr/local/lib/node_modules/grunt/lib/grunt/task.js:58:16)
at Task.<anonymous> (/usr/local/lib/node_modules/grunt/lib/util/task.js:343:36)
at Task.<anonymous> (/usr/local/lib/node_modules/grunt/lib/util/task.js:319:9)
at Task.<anonymous> (/usr/local/lib/node_modules/grunt/lib/util/task.js:346:11)
at Task.<anonymous> (/usr/local/lib/node_modules/grunt/lib/util/task.js:319:9)
at Task.<anonymous> (/usr/local/lib/node_modules/grunt/lib/util/task.js:346:11)
at Task.start (/usr/local/lib/node_modules/grunt/lib/util/task.js:359:5)
at Object.grunt.tasks (/usr/local/lib/node_modules/grunt/lib/grunt.js:143:8)

私のうなり声ファイルは次のようになります

module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({

    // Read in the project settings from the package.json file
    pkg: grunt.file.readJSON('package.json'),


    concat: {
        options: {
            separator: ';'
        },
        dist: {
            src: ['foundation/*.js'],
            dest: 'dist/<%= pkg.name %>.js'
        }
    },


});

// Load the plugin that provides the "concat" task.
grunt.loadNpmTasks('grunt-contrib-concat');

// Default task(s).
grunt.registerTask('default', ['concat']);

};

任意の助けをいただければ幸いです

4

1 に答える 1

2

この問題を解決するために、grunt をアンインストールし、最新のリリース候補をインストールし、npm cache clean でキャッシュをクリアして、concat モジュールの最新のリリース候補をインストールしました。それは今働いています。

于 2013-02-11T19:32:08.653 に答える