二、gulp报错The following tasks did not complete

gulp4.0 存在的错误信息 The following tasks did not complete: default,Did you forget to signal async completion?

当gulp为如下代码的时候:

//  以下代码会执行在node环境下
const gulp = require( "gulp" );

//  创建一个gulp的任务
gulp.task( "default",function(){
    console.log( "gulp default task" );
} );

运行结果:

The following tasks did not complete: default
Did you forget to signal async completion?

解决方法:

//  以下代码会执行在node环境下
const gulp = require( "gulp" );

//  创建一个gulp的任务
gulp.task( "default",function(done){
    console.log( "gulp default task" );
    done();
} );

猜你喜欢

转载自www.cnblogs.com/fger/p/12572723.html