Warning: connect.static is not a function
grunt-contrib-connect从0.11.x版本开始不支持connect.static和connect.directory
你应该安装serve-static(加载静态文件)和serve-index(加载目录)
npm install --save-dev grunt-contrib-connect serve-static
使用例子
var serveStatic = require('serve-static');
var serveIndex = require('serve-index');
grunt.initConfig({
connect: {
options: {
test: {
directory: 'somePath',
middleware: function(connect, options){
var _staticPath = path.resolve(options.directory);
return [serveStatic(_staticPath), serveIndex(_staticPath)]
}
}
}
}
})
Warning: connect.static is not a function的更多相关文章
- gulp connect.static is not a function
npm install --save serve-static var serveStatic = require('serve-static');
- warning: control reaches end of non-void function
用gcc编译一个程序的时候出现这样的警告: warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说你的一些 ...
- 解决warning: incompatible implicit declaration of built-in function 'malloc'
因为代码中使用了malloc函数和字符串函数.编译时出现错误 warning: incompatible implicit declaration of built-in function 'mall ...
- warning: incompatible implicit declaration of built-in function 'exit'
warning: incompatible implicit declaration of built-in function 'exit' 解决方法: 在头文件里 引入 stdlib 文件, #i ...
- warning: control reaches end of non-void function 和 warning: implicit declaration of function 'rsgClearColor' is invalid in C99
用gcc编译一个程序的时候出现这样的警告: warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说你的一些 ...
- 【gcc】warning: control reaches end of non-void function
用gcc编译一个C程序的时候出现这样的警告: warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说你的一 ...
- bug_ warning: control reaches end of non-void function
摘要 在leetcode上编译时,它显示我编译错误 warning: control reaches end of non-void function 它的意思是:控制到达非void函数的结尾.就是说 ...
- 删除: warning C4996: 'sprintf': This function or variable may be unsafe. Consider 方法
可以使用的最简单的方法: 选项Project | Configuration Properties | C/C++ | Preprocessor | Preproc ...
- warning: incompatible implicit declaration of built-in function ‘exit’
出现这个错误,一般是程序中某个函数没有include相关的文件. EG. 出现这个错误是因为要使用exit()应该包含stdlib.h文件
随机推荐
- Python装饰器主要用法
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = '人生入戏' user = "admin" passwd = ...
- ASP.Net开发WebAPI跨域访问(CORS)的精简流程
1: Web.config里有一行: <remove name="OPTIONSVerbHandler" /> 这个要删除. 2: nuget安装Microsoft.A ...
- ssl协议以及生成
一.https协议https是一安全为目标的httpt通道,简单讲师http的安全版.即http下加入ssl层,https的安全基础是ssl,因此加密的详细内容就需要ssl.http和https的区别 ...
- Azure SQL Database (24) 使用新管理界面,创建跨数据中心标准地域复制(Standard Geo-Replication)
<Windows Azure Platform 系列文章目录> 文本是对:SQL Azure (17) SQL Azure V12 - 跨数据中心标准地域复制(Standard Geo-R ...
- 这是一名Java学者关于学习方向的建议
无可厚非,编程是一门艺术.但是辉煌的背后必须是一段辛苦的奋斗过程,而过程的引导方向就是最重要的一环.Java语言可谓是引领了编程的潮流,你会是怎样去学的呢? 这是一名Java学者的学习方向的建议 注: ...
- 再说AutoComplete
一.简述 昨天support一同事,帮她的客户做类似下面的效果(自动完成): 以前在搜房的时候,弄过这个,调用楼盘字典: 这是一个小功能,也是一个大功能.因为它可以做大,也可以做小. 二.搜房的Aut ...
- 【京东详情页】——原生js学习之匿名函数
一.引言 在js模块中,要给每一个功能封装一个匿名函数.为了更好的理解什么是匿名函数,为什么要用匿名函数,我做了一些查阅和学习. 二.匿名函数 什么是:在创建时,不被任何变量引用的函数. 为什么:节约 ...
- Linux(centos)环境下Lamp环境搭建,成功版。
搭建环境必须条件:1.Linux环境,2.Apache,3.mysql ,4.PHP,搭建步骤如下 1.开启Linux,得到root权限:sudo su 接下来输入登录密码,进入root权限,因为安装 ...
- 【转】常用Maven插件
我们都知道Maven本质上是一个插件框架,它的核心并不执行任何具体的构建任务,所有这些任务都交给插件来完成,例如编译源代码是由maven- compiler-plugin完成的.进一步说,每个任务对应 ...
- IO模型分析
html { font-family: sans-serif } body { margin: 0 } article,aside,details,figcaption,figure,footer,h ...