Frage

after typing in the terminal na "grunt" and i got an error

Loading "Gruntfile.js" tasks...ERROR
>> TypeError: undefined is not a function
Warning: Task "default" not found. Use --force to continue.

Aborted due to warnings.

here my Gruntfile Gruntfile.js Gist

and my package.json

{
  "name": "mintsflow",
  "version": "0.0.0",
  "title": "Mintsflow - Front End Worflow",
  "author": "Ericson Luciano",
  "website": "http://ericsonluciano.me",
  "url": "http://mintsflow.ericsonluciano.me",
  "description": "A personal and easy to use front end workflow using sass and grunt.js ",
  "repository": {
    "type": "git",
    "url": "http://github.com/ericsonluciano/mintsflow.git"
  },
  "license": "MIT",
  "devDependencies": {
    "bower": "~1.3.3",
    "grunt": "~0.4.4",
    "grunt-contrib-sass": "~0.7.3",
    "grunt-contrib-concat": "~0.4.0",
    "grunt-contrib-imagemin": "~0.7.0",
    "grunt-contrib-connect": "~0.7.1",
    "grunt-contrib-uglify": "~0.4.0",
    "grunt-contrib-watch": "~0.6.1",
    "grunt-contrib-clean": "~0.5.0",
    "grunt-contrib-jshint": "~0.10.0",
    "grunt-autoprefixer": "~0.7.3",
    "grunt-open": "~0.2.3",
    "grunt-notify": "~0.3.0",
    "matchdep": "~0.3.0",
    "grunt-contrib-cssmin": "~0.9.0",
    "grunt-bower": "~0.13.1",
    "connect-livereload": "~0.4.0",
    "imagemin-mozjpeg": "~0.1.2"
  },
  "dependencies": {}
}

node -v "v0.10.26" npm -v "1.4.3" grunt --version "grunt-cli v0.1.13 grunt v0.4.4"

Let me know what wrong with my code. Thank you and have a great day.

War es hilfreich?

Lösung

I got it to work by replacing your package.json reader with another one.

Comment this line out or remove it all together from your gruntfile.js

require('matchdep').filterDev('grunt-*').forEach(grunt.loadNPMTasks);

Instead use this package reader, but add the line before the grunt.initConfig({

require('load-grunt-tasks')(grunt);

Of course add it to the package.json as well

npm install --save-dev load-grunt-tasks

I'm not sure why your other reader isnt working, but this'll get 'er grunting!

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top