错误**找不到模块'gulp-watch'**当我运行gulp时抛出。什么是错误的???
我安装了正确的大口
npm rm --global gulp
npm install --global gulp-cli
npm init
npm install --save-dev gulp
我创建了这个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)
2条答案
按热度按时间ss2ws0br1#
watch = require('gulp-watch');
需要此模块...您需要安装它:
npm install --save-dev gulp-watch
watbbzwu2#
**只需运行此命令-**npm install --save-dev gulp-watch