0

this is my gulpfile.js

const gulp = require('gulp');
gulp.task('default', function () {
});

I write gulp in my terminal and response is..

[19:47:02] Using gulpfile D:\DEV64\LearningJS\gulpfile.js

[19:47:02] Starting 'default'...

[19:47:02] The following tasks did not complete: default

[19:47:02] Did you forget to signal async completion?

what can i do?

Namkun
  • 27
  • 1
  • 6
  • have you tried logging to the console inside the task, just to see if it is being called? `console.log("Something")` – simonlchilds Dec 11 '18 at 12:14

2 Answers2

5

In Gulp 3.x you didn't need to signal completion. But from Gulp 4.x you need to do that.

Gulp automatically passes a callback function to your task as its first argument. Simple way in your case would be calling the callback.

gulp.task('default', function(done) {
  console.log("Started");
  done();
});

For more information You can check this question out: Gulp error: The following tasks did not complete: Did you forget to signal async completion?

Aritra Chakraborty
  • 9,464
  • 3
  • 18
  • 26
4

This works nicely for me.

gulp.task('default', async  function(){
  console.log("This is default task!");
});

You can also try this one.

gulp.task('default', async ()=>
 console.log('This is default task!')
);
Mobarak Ali
  • 681
  • 5
  • 17