By jamesd322
Following the tutorial mentioned above, part 4, rewriting app.js, I get this error, any suggestion on how to correct it? /root/socketio-test/app.js:9 var app = express(); ^ TypeError: object is not a function at Object.<anonymous> (/root/socketio-test/app.js:9:11) at Module.compile (module.js:456:26) at Object.Module.extensions…js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:902:3
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
express() can be used to create a server in express 3.x.x but in earlier versions the command would be
var app = express.createServer();
That would be the most common reason for the issue you’re seeing. The other possibility is that express was not installed properly via npm, re-doing the install may correct this if changing the express() call does not.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.