есть gulpfile.js:
var gulp = require('gulp');
sass = require('gulp-sass');
browserSync = require('browser-sync');
autoprefixer = require('gulp-autoprefixer');
pug = require('gulp-pug');
plumber = require('gulp-plumber');
gulp.task('sass', function(){
return gulp.src(['app/sass/**/*.sass', 'app/sass/**/*.scss'])
.pipe(sass({outputStyle: 'expanded'}).on('error', sass.logError))
.pipe(autoprefixer(['last 16 versions', '> 1%', 'ie 8', 'ie 7'], { cascade: true }))
.pipe(gulp.dest('app/css'))
.pipe(browserSync.reload({stream: true}))
});
gulp.task('pug', function(){
return gulp.src('app/pug/**/*.pug',)
.pipe(plumber())
.pipe(pug({
pretty: true
}))
.pipe(gulp.dest('app/'))
.pipe(browserSync.reload({stream: true}))
});
gulp.task('browser-sync', function() {
browserSync({
proxy: "localhost:8888",
notify: false
});
});
gulp.task('watch', ['browser-sync', 'sass'], function() {
gulp.watch(['app/sass/**/*.sass', 'app/sass/**/*.scss'], ['sass']);
gulp.watch("app/pug/**/*.pug", ['pug']);
gulp.watch("app/js/*.js", browserSync.reload);
});
при запуске (gulp watch) gulp выдает ошибку:
assert.js:385
throw err;
^
AssertionError [ERR_ASSERTION]: Task function must be specified
at Gulp.set [as _setTask] (C:\Users\Nikita\Desktop\as\test-gulp\node_modules\←[4mundertaker←[24m\lib\set-task.js:10:3)
at Gulp.task (C:\Users\Nikita\Desktop\as\test-gulp\node_modules\←[4mundertaker←[24m\lib\task.js:13:8)
at Object. (C:\Users\us\Desktop\as\test-gulp\gulpfile.js:35:6)
←[90m at Module._compile (internal/modules/cjs/loader.js:1158:30)←[39m
←[90m at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)←[39m
←[90m at Module.load (internal/modules/cjs/loader.js:1002:32)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:901:14)←[39m
←[90m at Module.require (internal/modules/cjs/loader.js:1044:19)←[39m
←[90m at require (internal/modules/cjs/helpers.js:77:18)←[39m
at execute (C:\Users\us\AppData\Roaming\npm\node_modules\←[4mgulp←[24m\node_modules\←[4mgulp-cli←[24m\lib\versioned\^4.0.0\index.js:36:18) {
generatedMessage: ←[33mfalse←[39m,
code: ←[32m'ERR_ASSERTION'←[39m,
actual: ←[33mfalse←[39m,
expected: ←[33mtrue←[39m,
operator: ←[32m'=='←[39m
}
Версия gulp - 4