Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8662209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:40:42+00:00 2026-06-12T16:40:42+00:00

I began learning Node.js today and I’m a little stuck. Following this example, I

  • 0

I began learning Node.js today and I’m a little stuck.

Following this example, I get the following error when I try executing the js file:

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:
https://github.com/visionmedia/express/wiki/Migrating-from-2.x-to-3.x
   info  - socket.io started

I don’t know how to fix this.

UPDATE

Error resulting from Bill’s modified code:

/home/sisko/NodeJS/nodeSerialServer/serialServer.js:24
var app     =   express()
                ^
ReferenceError: express is not defined
    at Object.<anonymous> (/home/sisko/NodeJS/nodeSerialServer/serialServer.js:24:12)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)
    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:40:44+00:00Added an answer on June 12, 2026 at 4:40 pm

    There was a change to how you initialize express apps between versions 2 and 3. This example is based on version 2 but it looks like you’ve installed version 3. You just need to change a couple of lines to set up socket.io correctly. Change these lines:

    var app = require('express').createServer(),
        io = require('socket.io').listen(app),
        scores = {};                                
    
    // listen for new web clients:
    app.listen(8080);
    

    to this:

    var express = require('express'),
        app = express()
      , http = require('http')
      , server = http.createServer(app)
      , io = require('socket.io').listen(server);
    
    // listen for new web clients:
    server.listen(8080);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I began learning Python a little time ago, and I got the first problem.
I am a newb to F#, just began learning it this afternoon. What I've
This is likely a dense question, seeing as I began learning how to script
For the first time, I began learning Javascript, however on the start I stuck
I've only just recent began learning C++ and am having a little issue with
I began learning Python a few days ago, and i was wondering about a
So just as I began to get a good grasp on MySQL, I found
I only began learning about web development 3 weeks ago and have grasped html,
I recently began learning C++ in order to reach people w/o .net. I need
I recently began learning Python, and I am a bit confused about how packages

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.