gruntjsgrunt-contrib-watchgrunt-contrib-jshint

Loading "Gruntfile.js" tasks...ERROR >> SyntaxError: Unexpected identifier, Task "default" not found


when I run grunt in my terminal, I got this error message, can anyone tell me why? I got an error message:Loading "Gruntfile.js" tasks...ERROR

SyntaxError: Unexpected identifier Warning: Task "default" not found. Use --force to continue.

module.exports = function(grunt){
require('load-grunt-tasks')(grunt);

var config = grunt.file.readYAML('Gruntconfig.yml');

grunt.initConfig({
    sass:{
        dist:{              
            src: config.scssDir+'style.scss',
            dest: config.cssDir+'style.css'
        }
    },
    concat:{
        dist:{
            src: config.jsSrcDir+'*.js',
            dest: config.jsConcatDir+'app.js'
        }
    },
    jshint:{
        options:{
            "eqeqeq": true
        }
        all:[
            'Gruntfile.js',
            config.jsSrcDir+"*.js"
        ]
    },
    watch:{
        sass:{
            files: config.scssDir+'**/*.scss',
            tasks:['sass']
        }
    }
});

grunt.registerTask('default',['jshint',
    'sass','concat','watch']);};

Solution

  • It means it can't compile the json in the gruntfile.

    You are lacking a comma

    jshint:{
        options:{
            "eqeqeq": true
        }<--- add comma here
        all:[
            'Gruntfile.js',
            config.jsSrcDir+"*.js"
        ]
    },