首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >发送警告: path.join的参数必须是字符串使用-强制才能继续

发送警告: path.join的参数必须是字符串使用-强制才能继续
EN

Stack Overflow用户
提问于 2013-05-29 06:01:56
回答 1查看 6K关注 0票数 13

我试图添加一个复制任务来复制一些js文件。但我得到了跟踪警告和文件停止复制。

代码语言:javascript
复制
Running "copy:group1" (copy) task
Warning: Arguments to path.join must be strings Use --force to continue.

Aborted due to warnings.

Gruntfile.js

代码语言:javascript
复制
module.exports = function(grunt) {

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

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

以下是grunt copy -v的结果

代码语言:javascript
复制
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已经有了Sorhus提到的修复程序。

提前谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-29 06:06:04

明白了,

dest属性必须是字符串。但不是阵列。

谢谢。

票数 34
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16806551

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档