title: Can not run node server file on Ubuntu server
body: <p>i am unable to start my <code>server.js</code> file on Ubuntu server.I installed all npm packages successfully.But when i run command <code>node server.js</code> The script is not executing at all and there is no error also. After hit enter it is again move back to the folder path in putty ssh.I am explaining my code below.</p>
  
  <blockquote>
    <p>server.js:</p>
  </blockquote>
  
  <pre><code>var port=8888;
  var express=require('express');
  var morgan = require('morgan');
  var http=require('http');
  var bodyParser= require('body-parser');
  var methodOverride = require('method-override');
  var mongo = require('mongojs');
  var database='Oditek';
  var collections=['video'];
  var app= express();
  var server=http.Server(app);
  var io=require('socket.io')(server);
  var db = mongo.connect("127.0.0.1:27017/"+database, collections);
  app.use(express.static(__dirname + '/public'));     // set the static files location /public/img will be /img for users
  app.use(morgan('dev'));                     // log every request to the console
  app.use(bodyParser.urlencoded({ extended: false }))    // parse application/x-www-form-urlencoded
  app.use(bodyParser.json())    // parse application/json
  app.use(methodOverride());                  // simulate DELETE and PUT
  db.on('ready', function () {
      console.log('database connected')
  });
  app.get('/',function(req,res){
      res.sendfile('view/login.html');
  });
  app.post('/login',function(req,res){
      var username=req.body.username;
      var password=req.body.userpassword;
      if(username &amp;&amp; password){
          db.video.findOne({
              username:username,
              password:password
          },function(err,doc){
              if(doc){
                  console.log('login',doc);
                  res.send(doc);
              }
              if(err){
                  console.log('login12',err);
                  res.send("could not login");
              }
          });
      }
  });
  app.get('/index',function(req,res){
      res.sendfile('view/index.html');
  });
  app.get('/video',function(req,res){
      res.sendfile('view/video.html');
  });
  app.get('/whiteboard',function(req,res){
      res.sendfile('view/whiteboard.html');
  });
  //socket----programming//
  var roomid;
  var clients={};
  io.on('connection',function(socket){
      //console.log('socket id',socket);
      if(socket.handshake.query.roomid){
        roomid=socket.handshake.query.roomid;
      }
      var usertype=socket.handshake.query.usertype;
      //var url=socket.handshake.headers.referer;
      //var myString = url.substr(url.indexOf("?") + 1);
      //var usertype=myString.substr(myString.indexOf("=")+1);
      //console.log('usertype',usertype);
      clients[usertype]={
          "socket":socket.id
      }
      console.log('clients',clients['admin'].socket);
      socket.on('admin-join',function(data){
          if(data.IsJoinAdmin){
              socket.join(roomid);
          }
      });
      socket.on('user-join',function(data){
          console.log('user wants to join',data);
          //console.log('user type',clients);
          if(data.isUserJoin){
              io.sockets.connected[clients[data.usertype].socket].emit('user-already-joined',data);
              socket.join(roomid);
          }
      });
      socket.on('send-playing-video-request-to-users',function(data){
          io.to(roomid).emit('sending-broadcasting',data);
      });
      socket.on('send-broadcasting-message',function(data){
          io.to(roomid).emit('sending-broadcasting',data);
      });
      socket.on('share-white-board',function(msg){
          io.to(roomid).emit('sharing-white-board',msg);
      });
      socket.on('disconnect', function() {
      for(var user in clients) {
          if(clients[user].socket === socket.id) {
              delete clients[user];
              io.to(roomid).emit('user-has-left',{userleft:true});
              break;
          }
      }   
    })
  
  });
  server.listen(port);
  console.log('server is listening on the port'+port);
  </code></pre>
  
  <p>at least the console message should execute if this file is running.But i am not getting like that.Please help me to resolve this error.</p>