user7259161
user7259161

Reputation:

Cannot find module 'gulp-watch' error throws

Error Cannot find module 'gulp-watch' throws when I run gulp. What is wrong???

I installed gulp properly

npm rm --global gulp
npm install --global gulp-cli
npm init 
npm install --save-dev gulp

I created this gulpfile.js

var gulp = require('gulp'), watch = require('gulp-watch');
var cssnano = require('gulp-cssnano');
var pump = require('pump');
var uglify = require('gulp-uglify');
var sass = require('gulp-sass');
// var htmlmin = require('gulp-htmlmin');

//Watch
gulp.task('stream', function () {
    // Endless stream mode 
    // gulp.watch('./css/*.scss', ['minifyHTML']);
    gulp.watch( 'assets/css/*.scss', ['styles']);
    gulp.watch( 'assets/js/*.js', ['scripts']);
    return watch('./css', { ignoreInitial: false })
        .pipe(gulp.dest('.'));
});

//bla bla (the rest)

Upvotes: 1

Views: 4940

Answers (2)

Md Ashikuzzaman
Md Ashikuzzaman

Reputation: 353

Simply run this command- npm install --save-dev gulp-watch

Upvotes: 0

C. Mürtz
C. Mürtz

Reputation: 504

watch = require('gulp-watch'); Requires this module...
You need to install it: npm install --save-dev gulp-watch

Upvotes: 4

Related Questions