Foros del Web » Programando para Internet » Node.js »

Task "compile" not found en grutnJS

Estas en el tema de Task "compile" not found en grutnJS en el foro de Node.js en Foros del Web. Estoy tratando de habilitar el task watch en grunt porque es un fastidio tener que correr grunt cada vez que quiero compilar y darme cuenta ...
  #1 (permalink)  
Antiguo 19/02/2014, 10:56
Avatar de nanotime  
Fecha de Ingreso: noviembre-2011
Ubicación: Cd. Guayana
Mensajes: 145
Antigüedad: 12 años, 5 meses
Puntos: 6
Pregunta Task "compile" not found en grutnJS

Estoy tratando de habilitar el task watch en grunt porque es un fastidio tener que correr grunt cada vez que quiero compilar y darme cuenta de que tengo como 20 errores, obviamente prefiero que me salte a decirme ¡Epa tienes un error! cuando lo cometo.

En fin, el watch funciona de cierto modo, si inicializa y si está "observando" el directorio, pero tengo dos problemas:

Declaro que observe varios directorios pero observa solo uno, aunque en el modo verbose me indica que efectivamente está observando a todos, hago cambios y solo reacciona con el de javascript, dejando en nada a los de jade y los de stylus.

El otro error, este si me tira un log, es el siguiente:

Código:
Running "watch" task
Waiting...OK
>> File "app/js/src/tareasController.coffee" changed.

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

Aborted due to warnings.
Mis carpetas son:

http://imgur.com/jjvyWoX (lo dejo en una imagen para que quede mas claro

y este es el gruntfile:

Código:
module.exports = (grunt) ->
  grunt.initConfig
      pkg: grunt.file.readJSON('package.json')

      coffee:
        compile:
          options:
            bare: true
          expand: true,
          flatten: true,
          cwd: 'app/js'
          src: ['**/*.coffee']
          dest: 'app/js/lib'
          ext: '.js'

      coffeelint:
        app: ['app/js/**/*.coffee', 'app/tests/**/*.coffee']

      jade:
        compile:
          options:
              pretty: true
          files:
              [
                expand: true
                cwd: 'app/views'
                src: '**/*.jade'
                dest: 'app/views/lib/'
                ext: '.html'
              ]
        compileIndex:
          options:
            pretty: true
          files: 'app/index.html': ['app/index.jade']

      stylus:
        compile:
          options:
            paths: ['/usr/local/lib/node_modules/jeet']
            import: ['index']
          files:
            'app/styles/css/styles.css': ['app/styles/**/*.styl']

      watch:
        coffee:
          files: 'app/js/**/*.coffee'
          tasks: 'compile'
        stylus:
          files: 'app/styles/**/*.styl'
          tasks: 'compile'
        jade:
          files: ['app/views/*.jade', 'app/index.jade']
          tasks: ['compile', 'compileIndex']

  grunt.loadNpmTasks 'grunt-contrib-coffee'
  grunt.loadNpmTasks 'grunt-coffeelint'
  grunt.loadNpmTasks 'grunt-contrib-jade'
  grunt.loadNpmTasks 'grunt-contrib-stylus'
  grunt.loadNpmTasks 'grunt-contrib-watch'

  # grunt.registerTask 'default', ['coffee', 'jade', 'stylus']
  grunt.registerTask 'default', ['watch:coffee', 'watch:stylus', 'watch:jade']
El output con la opción -v es este:

Código:
Initializing
Command-line options: --verbose

Reading "Gruntfile.coffee" Gruntfile...OK

Registering Gruntfile tasks.
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK

Registering "grunt-contrib-coffee" local Npm module tasks.
Reading /home/nano/Dev/angular-tutorial/node_modules/grunt-contrib-coffee/package.json...OK
Parsing /home/nano/Dev/angular-tutorial/node_modules/grunt-contrib-coffee/package.json...OK
Loading "coffee.js" tasks...OK
+ coffee

Registering "grunt-coffeelint" local Npm module tasks.
Reading /home/nano/Dev/angular-tutorial/node_modules/grunt-coffeelint/package.json...OK
Parsing /home/nano/Dev/angular-tutorial/node_modules/grunt-coffeelint/package.json...OK
Loading "coffeelint.js" tasks...OK
+ coffeelint

Registering "grunt-contrib-jade" local Npm module tasks.
Reading /home/nano/Dev/angular-tutorial/node_modules/grunt-contrib-jade/package.json...OK
Parsing /home/nano/Dev/angular-tutorial/node_modules/grunt-contrib-jade/package.json...OK
Loading "jade.js" tasks...OK
+ jade

Registering "grunt-contrib-stylus" local Npm module tasks.
Reading /home/nano/Dev/angular-tutorial/node_modules/grunt-contrib-stylus/package.json...OK
Parsing /home/nano/Dev/angular-tutorial/node_modules/grunt-contrib-stylus/package.json...OK
Loading "stylus.js" tasks...OK
+ stylus

Registering "grunt-contrib-watch" local Npm module tasks.
Reading /home/nano/Dev/angular-tutorial/node_modules/grunt-contrib-watch/package.json...OK
Parsing /home/nano/Dev/angular-tutorial/node_modules/grunt-contrib-watch/package.json...OK
Loading "watch.js" tasks...OK
+ watch
Loading "Gruntfile.coffee" tasks...OK
+ default

No tasks specified, running default tasks.
Running tasks: default

Running "default" task

Running "watch:coffee" (watch) task
Waiting...Verifying property watch exists in config...OK
Verifying property watch.coffee.files exists in config...OK
Watching app/js/src/tareasController.coffee for changes.
Ya he estado leyendo en stackoverflow, la documentación y ya probé los módulos independientemente y funcionan, ¿Qué estoy haciendo mal?

PD: si se dan cuenta, solo observa un directorio, aunque le dije que observara varios.
  #2 (permalink)  
Antiguo 20/02/2014, 12:35
Avatar de Carlangueitor
Moderador ლ(ಠ益ಠლ)
 
Fecha de Ingreso: marzo-2008
Ubicación: México
Mensajes: 10.037
Antigüedad: 16 años, 1 mes
Puntos: 1329
Respuesta: Task "compile" not found en grutnJS

Probaste con:

Código Javascript:
Ver original
  1. watch:
  2.         coffee:
  3.           files: 'app/js/**/*.coffee'
  4.           tasks: 'coffee'

?

Saludos
__________________
Grupo Telegram Docker en Español
  #3 (permalink)  
Antiguo 21/02/2014, 10:07
Avatar de nanotime  
Fecha de Ingreso: noviembre-2011
Ubicación: Cd. Guayana
Mensajes: 145
Antigüedad: 12 años, 5 meses
Puntos: 6
Respuesta: Task "compile" not found en grutnJS

Nope, no he probado, pero ... creo que ese es el error. En cuanto pueda vuelvo a darle y te doy respuesta. Gracias!

Edito, mil gracias por la ayuda, funcionó, era solo eso!

Última edición por nanotime; 21/02/2014 a las 13:36

Etiquetas: found, funcion, html, javascript, js
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 15:22.