title: Nodejs Redis createClient() function
body: <p>Can anyone solve this problem? I'm a node.js and redis beginner. </p>
  
  <p>The function <code>createClient()</code> can take 2 arguments: port and host. But I'm still stuck with this problem.</p>
  
  <pre><code>var client = redis.createClient(); 
  
  client.on('connect', function(){
      console.log('Redis client connected');
  });
  </code></pre>
  
  <blockquote>
    <p>Error: Redis connection to 127.0.0.1:6379 failed - connect
    ECONNREFUSED 127.0.0.1:6379
         C:\Users\my-pc\Desktop\FINAL>node index events.js:187
          throw er; // Unhandled 'error' event
          ^</p>
    
    <p>Error: Redis connection to 127.0.0.1:6379 failed - connect
    ECONNREFUSED 127.0.0.1:6379<br>
        at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1128:14) Emitted 'error' event on RedisClient instance at:
        at RedisClient.on_error (C:\Users\my-pc\Desktop\FINAL\node_modules\redis\index.js:406:14)
        at Socket. (C:\Users\my-pc\Desktop\FINAL\node_modules\redis\index.js:279:14)
        at Socket.emit (events.js:210:5)
        at emitErrorNT (internal/streams/destroy.js:92:8)
        at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
        at processTicksAndRejections (internal/process/task_queues.js:80:21) {   errno: 'ECONNREFUSED',<br>
    code: 'ECONNREFUSED',   syscall: 'connect',   address: '127.0.0.1',<br>
    port: 6379 }</p>
  </blockquote>