gulp 初識

使用gulp在有的教程中创建一个任务要这么写:

gulp.task('default',()=>{
  console.log("HTTP Server Started");
})

但是会报错提示

[10:44:30] The following tasks did not complete: default
[10:44:30] Did you forget to signal async completion?

所以说gulp的任务需要加入异步修饰符,要有如下写法:

gulp.task('default',async()=>{
  console.log("HTTP Server Started");
})

gulp.task('default', () => { 
  return new Promise(function(resolve, reject) {
    console.log("HTTP Server Started");
    resolve();
  });
});

问题解决

积累小的知识,才能成就大的智慧,希望网上少一些复制多一些原创有用的答案
原文地址:https://www.cnblogs.com/llcdbk/p/14665937.html