Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grunt doesn't give any output [Ubuntu]

Tags:

gruntjs

My grunt doesn't give any output, and I just installed all the system, NPM and grunt-cli. When I type "grunt -v" nothing is returned. This is my package.json:

{
  "name": "project",
  "version": "2.0.0",
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-contrib-coffee": "~0.7.0",
    "grunt-contrib-compass": "~0.6.0",
    "grunt-contrib-uglify": "~0.2.2",
    "grunt-contrib-watch": "~0.5.3",
    "grunt-yui-compressor": "~0.3.0",
    "grunt-contrib-cssmin": "~0.7.0"
  }
}

And my Gruntfile.coffee is:

module.exports = (grunt) ->

  # Project configuration.
  grunt.initConfig
    pkg: grunt.file.readJSON("package.json")

    coffee:
      glob_to_multiple:
        expand: true
        flatten: true
        src: ['assets/javascripts/source/*.coffee']
        dest: 'assets/javascripts/build/'
        ext: '.js'

    compass:
      dev:
        options:
          config: 'config.rb'

    cssmin:
      add_banner:
        options:
          banner: '/* Compilado em ' + grunt.template.today('dd/mm/yyyy') + ' */'
        files:
          'assets/styles/build/site.min.css': ['assets/styles/build/site.css']
          'assets/styles/build/site-ie7.min.css': ['assets/styles/build/site-ie7.css']

    uglify:
      dev:
        files:
          'assets/javascripts/build/scripts.min.js':[
            'assets/javascripts/build/scripts.js'
            'assets/javascripts/build/zt-validator.js'
            'assets/javascripts/build/jquery-zt.js'
          ]
      dist:
        files:
          'assets/javascripts/build/scripts-full.min.js':[
            'assets/javascripts/build/scripts.js'
            'assets/javascripts/build/zt-validator.js'
            'assets/javascripts/build/jquery-zt.js'
            'assets/javascripts/build/site.js'
          ]

    watch:
      options: { spawn: false }
      coffee:
        files: ["assets/javascripts/source/*.coffee"]
        tasks: ["coffee","uglify"]
      compass:
        files: ["assets/styles/**/*.sass","assets/styles/**/*.scss"]
        tasks: ["compass","cssmin"]


  grunt.loadNpmTasks "grunt-contrib-coffee"
  grunt.loadNpmTasks "grunt-contrib-watch"
  grunt.loadNpmTasks "grunt-contrib-compass"
  grunt.loadNpmTasks "grunt-contrib-cssmin"
  grunt.loadNpmTasks "grunt-contrib-uglify"

  # Default task(s).
  grunt.registerTask "default", ["coffee", "compass"]

I don't know how to debug it.

like image 712
Thiago Locks Avatar asked Nov 13 '13 11:11

Thiago Locks


Video Answer


2 Answers

Try removing the package "node". It's not related to NodeJS and removing it resolved the problem for me.

You can accomplish this by running sudo apt-get remove node and reinstall nodejs-legacy with sudo apt-get install nodejs-legacy

like image 149
igorcm Avatar answered Sep 23 '22 02:09

igorcm


I had to install 'node-legacy' on Ubuntu 13.10 in order to get 'grunt' working. Just installing 'node' was not enough.

like image 45
Tobias Weibel Avatar answered Sep 24 '22 02:09

Tobias Weibel