Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grunt Warning Task "watch" not found

Tags:

gruntjs

Gruntfile.js:

grunt.initConfig({
 watch: {
  compass: {
    files: [
      'app/styles/**/*.{scss,sass}'
    ],
    tasks: 'compass reload'
  },
.....
grunt.registerTask('dev', 'watch');

when i run

grunt dev 

i get the error

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

I use grunt-cli v0.1.6 and grunt v0.4.0, grunt-contrib-watch is installed.

like image 843
Serge Avatar asked Feb 20 '13 10:02

Serge


2 Answers

You don't have to install the whole contrib-package. There is a separate one for watch

npm install grunt-contrib-watch --save-dev

and at the end:

grunt.loadNpmTasks('grunt-contrib-watch');
like image 88
Kuno Avatar answered Sep 29 '22 08:09

Kuno


Well.

npm install grunt-contrib --save-dev

and add this line before the last line of grunt.js:

grunt.loadNpmTasks('grunt-contrib');

Also, i had to have Ruby installed...

like image 9
Serge Avatar answered Sep 29 '22 07:09

Serge