【问题标题】:grunt syntax error issue on running grunt task运行 grunt 任务时出现 grunt 语法错误问题
【发布时间】:2020-04-22 06:34:14
【问题描述】:
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"]);
};

第一次尝试 grunt,找不到任何关于问题的地方,这里有什么问题,当我运行 grunt copy 时会抛出错误。

正在加载“Gruntfile.js”任务...错误

SyntaxError: 无效或意外的令牌

警告:找不到任务“复制”。使用 --force 继续。*

任何帮助将不胜感激。

【问题讨论】:

    标签: javascript gruntjs


    【解决方案1】:

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

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

    已更正。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-08
      • 2018-11-21
      • 1970-01-01
      • 1970-01-01
      • 2015-03-23
      • 2013-02-23
      • 2014-06-23
      相关资源
      最近更新 更多