Gulp wont restart in any of my projects

37 views Asked by At

I've started using gulp for a few projects, mainly to watch my sass files.

Recently every time I go back to a project, I browse to it in terminal type 'gulp watch' and all that happens is gulp starts, runs 'watch' and finishes the task and my files aren't actually being watched.

I've had this working in numerous projects but all of a sudden I can't 'restart' work on anything as what I explained above happens.

Am i doing something obviously wrong?

Edit: here is some more info:

npm: 1.4.21

Gulp file:

    var gulp = require('gulp'),
        sass = require('gulp-sass'),
        autoprefixer = require('gulp-autoprefixer');


// SASS build
gulp.task('sass', function () {
    gulp.src('./sass/styles.sass')
            .pipe(sass({errLogToConsole: true}))
            .pipe(autoprefixer('last 2 versions'))
            .pipe(gulp.dest('./css'));
});


// Watch files
gulp.task('watch', function () {
    gulp.watch('./sass/**/*.sass', ['sass']);
});

gulp.task('default', ['watch', 'sass', 'autoprefixer']);
0

There are 0 answers