After installing Redis in our server as outlined in my last post on installation of Redis in CentOS 6.5, it was time for me to setup ExpressJS-NodeJS-Redis(Session Store) setup for the webapp that I am working on.
Everthing seemed perfect until I attempted to start the node server using the command:
node app.js. I was welcomed with the below error message which highlighted the fact that
connect-redis npm module had falied to connect to my Redis server.
var redis_store = require('connect-redis')(express); TypeError: Cannot read property 'prototype' of undefined at module.exports (/home/nodeuser/node_modules/connect-redis/lib/connect-redis.js:96:41) at repl:1:43 at REPLServer.self.eval (repl.js:110:21) at repl.js:249:20 at REPLServer.self.eval (repl.js:122:7) at Interface.<anonymous> (repl.js:239:12) at Interface.EventEmitter.emit (events.js:95:17) at Interface._onLine (readline.js:202:10) at Interface._line (readline.js:531:8) at Interface._ttyWrite (readline.js:760:14)
Upon scouting Internet for answers, the solution posted by Andrei Karpushonak at StackOverflow post titled, ‘RedisStore – TypeError: Cannot read property ‘prototype’ of undefined‘ solved the issue.
connect-redis-1.4.7 using the command:
npm install --save firstname.lastname@example.org and the webapp started without reporting any failures.