grunt运行任务时出现语法错误问题。

huangapple go评论81阅读模式
英文:

grunt syntax error issue on running grunt task

问题

module.exports = function(grunt){
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        copy: {
            t1: {
                src: 'dir1/*',
                dest: 'dir2/'
            }
        }
    });
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.registerTask('default', ["copy"]);
};
英文:
module.exports = function(grunt){
 grunt.initConfig({
 	pkg: grunt.file.readJSON('package.json'),

 	copy: {
        t1:{
       	  src: 'dir1/*',
       	  dest: 'dir2/'
          }
 	    }
 });
 grunt.loadNpmTasks('grunt-contrib-copy);
 grunt.registerTask('default', ["copy"]);
};

Trying grunt first time, could not find anywhere about issue, what is problem here, when i ran grunt copy it throws error.

>>Loading "Gruntfile.js" tasks...ERROR

>> SyntaxError: Invalid or unexpected token
>>
Warning: Task "copy" not found. Use --force to continue.*
>

Any help would be greatly appreciated.

答案1

得分: 1

抱歉,这是语法错误,我的IDE没有显示任何错误提示。

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

这已经更正。

英文:

Sorry it's syntax error, my IDE not shown any error indications.

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

this is corrected.

huangapple
  • 本文由 发表于 2020年1月4日 01:35:24
  • 转载请务必保留本文链接:https://go.coder-hub.com/59582911.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定