I am having serever.js file which contains the below code. I am having another package.json file which have dependencies. I later added underscore dependency to the existing dependency. It's throwing error on require("socket.io")(http) as require(...) is not a function. When I run the file using command node server error is coming after adding dependency.
var express = require('express');
var app = express();
var bodyParser = require('body-parser');
var http = require('http').Server(app);
var io = require("socket.io")(http);
package.json
"dependencies": {
"express": "~3.4.0",
"jade": "*",
"socket.io": "0.8.x",
"logfmt": "~1.1.2",
"nodemailer": "~0.7.0",
"mongoose": "^4.2.4",
"body-parser": "~1.4.3",
"underscore": "~1.5.2" // when I add this line error is coming.
}
Can some one suggest me on this.
