Error: Most middleware (like favicon) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.

Solution:

For Express 4 :
// Serve favicon.ico.

$> npm install serve-favicon

Then in your server .js script :
var favicon = require(‘serve-favicon’);
app.use(favicon(options.favicon));

For Express 3 :

This is likely the syntax that gave you the error above

app.use(express.favicon(options.favicon));

Most middleware (like favicon) is no longer bundled with Express的更多相关文章

  1. Error: Most middleware (like bodyParser) ...

    运行NodeJS时出现如下错误: Error: Most middleware (like bodyParser) is no longer bundled with Express and must ...

  2. .1-浅析express源码之入口文件

    鸽了鸽了,webpack源码大垃圾,看了那么久,感觉自己越来越渣……还是换个口味,node了解一下? 尝试从express框架源码入手,学习一下node的http模块相关的知识. 入口文件 先从框架的 ...

  3. Express 4 中如何使用connect-mongo

    正在跟随上面的教程一步一步做,在会话支持那一节中安装 connect-mongo 后,添加: var MongoStore = require('connect-mongo')(express); v ...

  4. 跟踪对象属性值的修改, 设置断点(Break on property change)

    代码 //Break on property change (function () { var localValue; Object.defineProperty(targetObject, 'pr ...

  5. nodejs 如何获取页面get、post传递过来的参数

    如果是get传递参数,可以直接使用 request.query.name 如果是post 需要借助body-parser 首先引入bodyParser = require('body-parser') ...

  6. 学习Nodejs:《Node.js开发指南》微博项目express2迁移至express4过程中填的坑

    <Node.js开发指南>项目地址https://github.com/BYVoid/microblog好不容易找到的基础版教程,但书中是基于express2的,而现在用的是express ...

  7. NodeJS - Express 4.0错误:Cannot read property 'Store' of undefined

    按着<NodeJS开发指南>里的第五章建立microblog的例子操作,使用node.js 的express框架配置将session存储到mongodb时出错:TypeError: Can ...

  8. node.js express开发web问题

    1.新建的layout.ejs,在里面使用了<%= title %>,但是在运行时提示title is not defined. 将title改为<%= locals.title % ...

  9. nodejs教程 安装express及配置app.js文件的详细步骤

    来自:http://www.jb51.net/article/36710.htm   express.js是nodejs的一个MVC开发框架,并且支持jade等多种模板.下面简单来说说express的 ...

随机推荐

  1. python两个文件的对比

    #encoding=utf-8 class SyncPagemaptoDB(object): def loadOldmap(self,oldpage,newpage,new_version): map ...

  2. 转:LIRE的使用

    LIRE的使用:创建索引 LIRE(Lucene Image REtrieval)提供一种的简单方式来创建基于图像特性的Lucene索引.利用该索引就能够构建一个基于内容的图像检索(content- ...

  3. Bitbucket Repository size limits

    Repository size limits By Justen Stepka, Product Manager on May 30, 2014 In order to improve and mai ...

  4. LPC43xx Dual-core or Multi-core configuration and JLink Debug

    Test access port (TAP) JTAG defines a TAP (Test access port). The TAP is a general-purpose port that ...

  5. zz Windows 10安装教程:硬盘安装Win10 系统步骤(适合32位和64位)

    Windows 10安装教程:硬盘安装Win10 系统步骤(适合32位和64位) Posted on 2015年01月28日 by 虾虾 22 Comments   最新的Windows 10 MSD ...

  6. arcgis打开图层后右下角坐标小数点位数调整

    打开arcmap,加载图层后,在其右下方会显示鼠标移动的点坐标,但是默认显示的小数点只有三位,如果是经纬度坐标,只有三位的话不够精确,因此想着能否改变其显示的精度,搜了半天,算是搜到了,但是过了一段时 ...

  7. Grunt 新手指南

    导言 作为一个正在准备从java 后端转大前端,一直都有想着,在js 的世界里面有没有类似于maven或者gradle 的东西..然后,就找到了grunt 这玩意 Grunt是用来干什么的 诸如ant ...

  8. 将自己写的windows服务加入到windows集群中

    最近发现windows集群能进行很多自定义,比如在集群中加入自己编写的服务. 能自定义的可不少,截个图: 本次演示中,只想用“通用服务”这个类型. 先列下步骤 编写一个记录时间的Windows服务,这 ...

  9. Scala深入浅出实战经典之 List的foldLeft、foldRight、sort操作代码实战

     Scala 深入浅出实战经典(1-64讲)完整视频.PPT.代码下载:百度云盘:http://pan.baidu.com/s/1c0noOt6 腾讯微云:http://url.cn/TnGbdC 3 ...

  10. [GraphQL] Serve a GraphQL Schema as Middleware in Express

    If we have a GraphQL Schema expressed in terms of JavaScript, then we have a convenient package avai ...