thomasdavis/backbonetutorials

Nohm Error

Opened this issue · 1 comments

Not sure if I'm missing something, but if I clone the project and try to run the server using node for the video tutorial, I get:

node server.js 
{ name: 'Nohm Error',
  message: 'Warning: setClient() received a redis client that is not connected yet. Consider waiting for an established connection before setting it.' }

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED
    at RedisClient.on_error (/net/iwebdev2/export/home/web/public/htdocs/staff/cohenaa/projects/video-backbone-beginner-server/node_modules/redis/index.js:189:24)
    at Socket.<anonymous> (/net/iwebdev2/export/home/web/public/htdocs/staff/cohenaa/projects/video-backbone-beginner-server/node_modules/redis/index.js:95:14)
    at Socket.EventEmitter.emit (events.js:95:17)
    at net.js:441:14
    at process._tickCallback (node.js:415:13)

I'd love to follow the tutorial without mocking up the responses. Any help is much appreciated! I did google this error and saw something on SO about calling setClient(redis), but it looks like that's already being done.

Hey not sure if you still want an answer to this but thought I'd leave a comment anyway.
The 'Nohm Error' you're getting is actually just a warning, to resolve it you just need to wait until the redis client is connected before setting the client. This can be done by replacing 'nohm.setClient(redis);' with this:
redis.on("connect", function() {
nohm.setClient(redis);
//Anything you do afterwards that relies on the nohm client
});
This means that the client won't get set until after the redis client is connected.

As for your actual redis connection error, the issue there is that you're probably not actually running an instance of the redis server on your machine, or it's on a different port other than the default 6379. Make sure you have redis installed and a server running before running your server.js file.

Hope this helps. :)