javascriptnode.jsgruntjsgrunt-contrib-uglifygrunt-cli

Grunt: Task "default" not found


I am trying to set up some simple Grunt tasks but upon running them I get a Warning in the terminal "Warning: Task "default" not found.

I have simplified the gruntfile down to just one task, to reduce the chance this was caused by syntax errors but I am still getting the same warning...

gruntfile.js

exports.module = function (grunt) {
grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    uglify: {
        build: {
            files: {
                '/public/scripts/test.min,js' : ['/public/scripts/test.js']
            }
        }
    }
});

grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.registerTask('default', ['uglify']);

};

package.json

 {
      "name": "CustomersCRUD",
      "version": "0.0.1",
      "description": "Customer CRUD Application",
      "main": "app.js",
      "scripts": {
          "test": "echo \"Error: no test specified\" && exit 1"
      },
      "author": "Dan Hutchinson",
      "license": "ISC",
      "dependencies": {
        "express": "^4.6.1",
        "serve-favicon": "^2.0.1"
      },
      "devDependencies": {
         "grunt": "^0.4.5",
         "grunt-contrib-uglify": "^0.5.0"
      }
     }

warning given

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

Aborted due to warnings.

Many thanks!


Solution

  • Okay, didn't catch this before but it's module.exports not exports.module

    That should fix it. Also, I don't believe your file references need a / before them.