gulp:提示:Error: watching html/*: watch task has to be a function (optionally generated by using gulp
提示: Error: watching html/*: watch task has to be a function (optionally generated by using gulp.parallel or gulp.series)
原因:
从gulp4.0开始,watch函数的第二个参数必须是函数。
即以前的写法不再支持。
以前的写法
gulp.watch(“监听的文件”,["任务名字符串"]);
gulp4.0的写法
gulp.watch(“监听的文件”,回调函数);
示例:
gulp4.0的写法
function upLoadHtml() {gulp.src('html/*').pipe(gulp.dest('D:\\phpStudy\\PHPTutorial\\WWW\\jd\\html'));
}
gulp.task("watch",async ()=>{gulp.watch("html/*", async ()=>{ upLoadHtml(); });});
以前的写法(4.0不支持)
gulp.task("upLoadHtml",async ()=>{
gulp.src('html/*')
.pipe(gulp.dest('D:\\phpStudy\\PHPTutorial\\WWW\\jd\\html'));
});
gulp.task("watch",async ()=>{
gulp.watch("html/*",["upLoadHtml"]);
});
gulp:提示:Error: watching html/*: watch task has to be a function (optionally generated by using gulp相关推荐
- Error: watch task has to be a function(optionally generated by using gulp.parallel or gulp. series)
請先在命令端輸入glup -v查看版本 如果版本為4.X.X,請先移除glup npm uninstall gulp -g 並把項目端的node_modules文件夾刪除掉 並把package.jso ...
- gulp4.0的坑:提示: Error: watching index.html: watch task has to be a function (optionally generated by u
提示: Error: watching index.html: watch task has to be a function (optionally generated by using gulp. ...
- gulp--解决watching xx.html : watch task has to be a function的问题
gulp监听,如果监听到文件有改动,会自动执行相应的任务,更新数据 错误提示:watching test.html: watch task has to be a function (optional ...
- 【Android】Error:Execution failed for task ':app:lint'
详细信息如下: Error:Execution failed for task ':app:lint'. > Lint found errors in the project; aborting ...
- @Scheduled出现Unexpected error occurred in scheduled task
使用@Scheduled定时任务,项目启动后报错Unexpected error occurred in scheduled task,并提示空指针异常 解决办法: 实现ApplicationCont ...
- Error:Execution failed for task ':xst:process开发环境DebugResources'.
用的gradle:2.3.3,编译时出现错误: Error:Execution failed for task ':xst:process开发环境DebugResources'. > com.a ...
- Error watching file for changes: EMFILE
运行reactnative项目时在编译过程中报错 Error watching file for changes: EMFILE 故障原因: 是升级后watchman不可用了,需要重装watchman ...
- 完美解决Error:Execution failed for task ':APP:transformClassesWithDexForDebug'...问题
今天下载一个demo运行出现问题,错误如下图 我的问题是JDK 1.8 版本问题问题,我吧1.8改成1.7运行成功 这个实在app下面的build.gradle 相信大伙在Android开发过程中都避 ...
- 安卓中运行报错Error:Execution failed for task ':app:transformClassesWithDexForDebug'解决
在androidstuio中运行我的未完项目,报错: Error:Execution failed for task ':app:transformClassesWithDexForDebug'. & ...
最新文章
- 使用ISA Server 2006的DMZ区保护内网的服务器群
- 今天收拾了个电脑抽屉,发现原来我是个有钱人
- 十一、Struts2封装请求参数的方式
- AMIO编辑器开发(三):转向C++,月底遇到第二个瓶颈
- opencv3.2.0形态学滤波之开运算、闭运算
- java 叉号关闭_求助 java 如何编写JFrame窗体右上角红色打叉关闭按钮的事件?
- 在shop++二次开发中金额数据类型BigDecimal转换,注意细节。
- c语言判断输入类型是否为指定类型?
- 大屏数据可视化源码_数据可视化大屏快速入门
- 具体化和实例化的应用
- DirectX SDK 安装时出现错误 [Error Code:S1023] 的解决方案
- UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xae in position解决办法
- python抽奖游戏、某商场为了促销_详解python--模拟轮盘抽奖游戏
- 11 Django REST Framework 针对基于类的视图添加 @csrf_exempt
- 微电子新手入门之 Origin画图
- 计算机二级MS office的高频考点~
- 怎么建立软连接和删除软连接、宏定义个声明一年有多少秒、关于自定义函数类型指针
- MATLAB 安装 MCR
- 谈谈客户关系管理系统的应用与发展
- 刘强东不学编程,今天很可能没有京东......一位码农的发家致富史