A
A
Andrew2019-04-30 21:50:58
gulp.js
Andrew, 2019-04-30 21:50:58

Why is an error displayed when executing several tasks in one?

There is a task:
gulp.task('watch',['browser-sync','prefix'],function(){
gulp.watch('fashion/*.html');
});
and when you run this task, an error is displayed:
5cc898f99009e656068488.jpeg
browser-sync and prefix separately run without problems.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Dobrin, 2019-04-30
@andreydobrin

You are using version 3 Gulp.
To solve your problem, you need:
If you want to take a step on the first option, you will have to enter this command into the console:
npm uninstall -g gulp && npm i -g [email protected]and your code will work.
Otherwise, leave yours Gulp 4and follow this link and read the instructions.
Here is the code for you Gulp 4:

gulp.task('watch', function(){
  browserSync.init({
      сюда конфиг вашего сервера
});
  gulp.watch("Путь к файлам Html", gulp.series('html'));  // <--- В кавычках название таска
  gulp.watch("Путь к файлам CSS", gulp.series('prefix'));
})

I will explain at the expense of paralleland series. That is, in the first case, your task-and in the thread are executed together. And in another case, the first one will be executed first task, then the second, the third and to the end.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question