Redis connection to 127.0.0.1:6379 failed - connect ECONNREFUSED

Huy Tran picture Huy Tran · Jan 6, 2012 · Viewed 197.9k times · Source

I working with node.js by expressjs
I try to store an account to session. So, i try to test to use session with code in expressjs

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.
Please help me resolve this problem

Answer

piggyback picture piggyback · Jun 22, 2012

After you install redis, type from terminal:

redis-server

and you'll have redis running