Node.js   发布时间:2022-04-24  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了gruntjs – grunt-contrib-copy throwing警告:path.join的参数必须是字符串使用–force继续大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在尝试添加一个复制任务来复制一些js文件.但是我收到以下警告,文件停止复制.

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

Aborted due to warnings.

Gruntfile.js

@H_235_7@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提到的修复.

提前致谢.

解决方法

得到它了,

dest属性必须是字符串.但不是一个数组.

谢谢.

大佬总结

以上是大佬教程为你收集整理的gruntjs – grunt-contrib-copy throwing警告:path.join的参数必须是字符串使用–force继续全部内容,希望文章能够帮你解决gruntjs – grunt-contrib-copy throwing警告:path.join的参数必须是字符串使用–force继续所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。