gulp执行任务报错The following tasks did not complete: first,Did you ...?gulp构建全局任务时报错AssertionError [ERR_A

gulp执行任务报错
错误信息: The following tasks did not complete: first,Did you forget to signal async completion?
在这里插入图片描述
解决办法
使用done来进行回调函数,如下图所示:
在这里插入图片描述
修改后,任务可以顺利执行了
在这里插入图片描述

gulp构建全局任务时报错
错误信息:AssertionError [ERR_ASSERTION]: Task function must be specified
at Gulp.set [as _setTask] (G:\study\Node\node_modules\undertaker\lib\set-task.js:10:3)
at Gulp.task (G:\study\Node\node_modules\undertaker\lib\task.js:13:8)
at Object. (G:\study\Node\myGulp\gulpfile.js:57:6)….
在这里插入图片描述
解决办法
在调用的函数名前加上gulp.series函数即可,如下图所示:
在这里插入图片描述
保存文件执行,可以看到任务执行完成
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/weixin_42199245/article/details/106237089