I'm created chat with nodejs in visual studio and it's working well on my localhost but my website on azure, so i created virtual machine (windows server 2012).(Note : it is not a classic virtual machine)
and installed necessary software NodeJS.and copy my nodejsapp folder into virtual machine.

Snippet code here (server.js)...

```
var app = require('express')();
var http = require('http').Server(app);
var io = require('socket.io').listen(http);
var sql = require('mssql');

var config = {
    user: 'xxxxx',
    password: 'xxxxxxxxxxx',
    server: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx',
    database: 'xxxxx',

    options: {
        encrypt: true // Use this if you're on Windows Azure
    }
}
console.log(config); 

io.sockets.on('connection', function(socket){

   socket.on('join room', function (data) {console.log('joined-->'+data.email);
        socket.join(data.email); 
    });

   socket.on('leave room', function (data) {console.log('Leaved-->'+data.email);
        socket.leave(data.email); 
    });

    socket.on('message', function (data) {
            console.log('sent==>'+data.id+"  , "+data.to+'  ,  '+data.from+'  ,  '+data.msg  );
            io.sockets.in(data.to).emit('chat message', {id: data.id, to:data.to,from: data.from, msg: data.msg });

    });    

});

http.listen(5556, function(){
  console.log('listening on *:5556');
});

```

after that using command prompt try to run server.js but not run node.

[![enter image description here](https://i.stack.imgur.com/iPOqi.png)](https://i.stack.imgur.com/iPOqi.png)

it's working on local machine but not in vm.

Can anyone point me in the right direction?