2013-02-11 70 views
2

我第一次嘗試grunt.js並且遇到一些初學者問題。使用grunt.js的連接錯誤

我想Concat的在/基礎/文件夾中的所有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']); 

} ;

任何幫助,將不勝感激

回答

2

要解決這個問題,我卸載咕嚕,安裝了最新的候選版本,清除與NPM緩存清理緩存並安裝了CONCAT模塊的最新發布候選。現在正在工作。