英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论