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

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

grunt syntax error issue on running grunt task

问题

  1. module.exports = function(grunt){
  2. grunt.initConfig({
  3. pkg: grunt.file.readJSON('package.json'),
  4. copy: {
  5. t1: {
  6. src: 'dir1/*',
  7. dest: 'dir2/'
  8. }
  9. }
  10. });
  11. grunt.loadNpmTasks('grunt-contrib-copy');
  12. grunt.registerTask('default', ["copy"]);
  13. };
英文:
  1. module.exports = function(grunt){
  2. grunt.initConfig({
  3. pkg: grunt.file.readJSON('package.json'),
  4. copy: {
  5. t1:{
  6. src: 'dir1/*',
  7. dest: 'dir2/'
  8. }
  9. }
  10. });
  11. grunt.loadNpmTasks('grunt-contrib-copy);
  12. grunt.registerTask('default', ["copy"]);
  13. };

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:

确定