2013-05-29 8 views
13

Tôi đang cố gắng thêm một tác vụ sao chép để sao chép một số tệp js. Nhưng tôi nhận được cảnh báo sau và các tập tin ngừng sao chép.grunt-contrib-copy throwing Cảnh báo: Đối số đến path.join phải là chuỗi Sử dụng --force để tiếp tục

Running "copy:group1" (copy) task 
Warning: Arguments to path.join must be strings Use --force to continue. 

Aborted due to warnings. 

Gruntfile.js

module.exports = function(grunt) { 

    grunt.initConfig({ 
     copy : { 
       group1 : { 
      files : [ 
       { 
         src : ['group1/js/*'], 
         dest : ['lib/group1/js/'] 
        } 
       ] 
      } 
     } 
    }); 

    grunt.loadNpmTasks('grunt-contrib-copy'); 
}; 

Sau đây là kết quả của grunt copy -v

Initializing 
Command-line options: --verbose 

Reading "Gruntfile.js" Gruntfile...OK 

Registering Gruntfile tasks. 
Initializing config...OK 

Registering "grunt-contrib-copy" local Npm module tasks. 
Reading /home/sasidhar/projects/grunt/node_modules/grunt-contrib-copy/package.json...OK 
Parsing /home/sasidhar/projects/grunt/node_modules/grunt-contrib-copy/package.json...OK 
Loading "copy.js" tasks...OK 
+ copy 
Loading "Gruntfile.js" tasks...OK 
>> No tasks were registered or unregistered. 

Running tasks: copy 

Running "copy" task 

Running "copy:group1" (copy) task 
Verifying property copy.group1 exists in config...OK 
Files: group1/js/js1.js, group1/js/js2.js, group1/js/js3.js -> lib/group1/js/ 
Options: processContent=false, processContentExclude=[] 
Warning: Arguments to path.join must be strings Use --force to continue. 

Aborted due to warnings. 

Tôi đã gọi Stackoverflow Question khác về lỗi tương tự. Nhưng GruntJS của tôi đã được sửa chữa bởi Sindre Sorhus.

Cảm ơn trước.

Trả lời

34

OK,

dest thuộc tính phải là chuỗi. nhưng không phải là một mảng.

Cảm ơn.

+2

Trình tiết kiệm cuộc sống. Tiết kiệm thời gian. Anh hùng. –