ошибка при запуске gulp со всеми плагинами
ошибка при запуске gulp со всеми плагинами
const gulp = require('gulp');
const browserSync = require('browser-sync');
const sass = require('gulp-sass');
const rename = require("gulp-rename");
const autoprefixer = require('gulp-autoprefixer');
const CleanCSS = require('clean-css');
// Static server
gulp.task('server', function() {
browserSync.init({
server: {
baseDir: "src"
}
});
});
gulp.task('styles', function() {
return gulp.src("src/sass/*.+(scss|sass)")
.pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError))
.pipe(rename({
prefix: "",
suffix: ".min"
}))
.pipe(autoprefixer({
browsers: ['last 2 versions'],
cascade: false
}))
.pipe(CleanCSS({compatibility: 'ie8'}))
.pipe(gulp.dest("src/css"))
.pipe(browserSync.stream());
});
gulp.task('watch', function() {
gulp.watch("src/sass/*.+(scss|sass)", gulp.parallel("styles"));
gulp.watch("src/*.html").on("change", browserSync.reload);
});
gulp.task('default', gulp.parallel('watch', 'server', 'styles'));
Сообщение об ошибке в терминале vs kod:
$ gulp
[20:53:21] Using gulpfile C:\WebServers\home\beONmax\www\UBER\gulpfile.js
[20:53:21] Starting 'default'...
[20:53:21] Starting 'watch'...
[20:53:21] Starting 'server'...
[20:53:21] Starting 'styles'...
[20:53:21] 'styles' errored after 102 ms
[20:53:21] TypeError: Cannot read property 'on' of undefined
at DestroyableTransform.Readable.pipe (C:\WebServers\home\beONmax\www\UBER\node_modules\readable-stream\lib\_stream_readable.js:564:8)
at C:\WebServers\home\beONmax\www\UBER\gulpfile.js:28:14
at styles (C:\WebServers\home\beONmax\www\UBER\node_modules\undertaker\lib\set-task.js:13:15)
at bound (domain.js:426:14)
at runBound (domain.js:439:12)
at asyncRunner (C:\WebServers\home\beONmax\www\UBER\node_modules\async-done\index.js:55:18)
at processTicksAndRejections (internal/process/task_queues.js:79:11)
[20:53:21] 'default' errored after 111 ms
[20:53:21] The following tasks did not complete: watch, server
[20:53:21] Did you forget to signal async completion?