For people that has this problem when using node.js & express app, here I show you way to solve it.

The error that you will see upon start the node.js:

Warning: express.createServer() is deprecated, express
applications no longer inherit from http.Server,
please use:

  var express = require(“express”);
  var app = express();

Socket.IO’s `listen()` method expects an `http.Server` instance
as its first parameter. Are you migrating from Express 2.x to 3.x?
If so, check out the “Socket.IO compatibility” section at:
   info  – started

The solution is to change this line:

var app = require(‘express’).createServer(),
    io = require(‘’).listen(app),
    scores = {};                               

// listen for new web clients:

to this:

var express = require(‘express’),
    app = express()
  , http = require(‘http’)
  , server = http.createServer(app)
  , io = require(‘’).listen(server);

// listen for new web clients:

Try to start again. Problem solve. 🙂

By zam

Related Post

Any Comments?

This site uses Akismet to reduce spam. Learn how your comment data is processed.