我正在尝试添加复制任务来复制一些js文件。但是我收到了警告并且文件停止了复制。
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');
};
以下是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.
我已经就类似的错误提到了其他Stackoverflow Question。但我的GruntJS已经有了Sindre Sorhus提到的解决方案。
先谢谢。
答案 0 :(得分:34)
知道了,
dest
属性必须是字符串。但不是数组。
感谢。