剛剛在Ubuntu 12.04上安裝了最新的Grunt。這裏是我的gruntfile:Grunt Concat無法寫入文件
module.exports = function(grunt){
//project configuration
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
concat: {
slides : {
src : ['src/top.html', 'src/bottom.html'],
dest : ['build/index.html']
}
}
});
//enable plugins
grunt.loadNpmTasks('grunt-contrib');
grunt.registerTask('default', ['concat:slides']);
}
這在構建/目錄罰款,但給我的輸出:
運行 「CONCAT:幻燈片」(CONCAT)任務警告:無法寫入 「 build/index.html「文件(錯誤代碼:undefined)。繼續使用 - force至 。
我試着在目錄上運行chmod 777,因爲我認爲它可能與權限有關,但似乎沒有改變任何東西。
我該如何讓Grunt寫入build/index.html?
我有同樣的問題,找到了類似的問題,並根據您的答案給出了[詳細解答](http://stackoverflow.com/a/17626981/1092815)。所有學分去給你,非常感謝:) – GabLeRoux 2013-07-13 04:32:16
這個答案幫助我解決了另一個語法錯誤。確保使用'dest'而不是'dst'。 – 2013-08-23 12:04:08
謝謝,真的救了我培根......時間明智:) – 2014-03-21 19:46:12