title: NodeJS can not connect to Redis
body: <p>I have nodejs app which needs to connect to Redis database.
  However, when trying to connect to Redis it always returns "<strong>false</strong>".
  I have running Redis instance on the same machine which is accessible from cli, also have another nodejs app which is connected to this same instance of Redis.</p>
  
  <p>I don'g see anything wrong in /var/log/redis/redis-server.log nor printed in the console.</p>
  
  <p>Any ideas what might be the issue?</p>
  
  <p>$ nodejs -v
  v8.11.1</p>
  
  <p>$redis-server -v
  Redis server v=4.0.9 sha=00000000:0 malloc=jemalloc-3.6.0 bits=64 build=1bc80a08306a3efd</p>
  
  <pre><code>const redis = require('redis'),
  redisClient = redis.createClient(6379, '127.0.0.1');
  
  const REDIS_USER_DATA_INDEX = 2;
  
  redisClient.select(REDIS_USER_DATA_INDEX);
  
  redisClient.on('connect', function () {
      console.log('redis connected');
  }).on('error', function (error) {
      console.log(error);
  });
  
  console.log(`connected ${redisClient.connected}`);
  </code></pre>
  
  <p><strong>EDIT</strong>
  I'm not getting any events in both redisClient.on() callbacks</p>