Alex Rivera | Logout

Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED

Asked 2012-01-06T06:40:03.563
195

I am working with Node.js and Express.js.
I try to store an account in session. So, I tried to use a session with this code in Express.js

var RedisStore = require('connect-redis')(express);
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.session({ secret: "keyboard cat", store: new RedisStore }));

but I got error:

Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED

Edit
Report

1 Answer

272

After you install redis, type from terminal:

redis-server

and you'll have redis running

answered 2012-06-21T23:16:53.157

Your Answer