10
votes

When I run the app I get that message. I am trying to follow the instructions described here

This is a portion of my app.js file

var express = require('express');
var RedisStore = require('connect-redis')(express); 
var redisStore = new RedisStore(); // setup redis
var flash = require('connect-flash');
var passport = require('passport');
var LocalStrategy = require('passport-local').Strategy;
var routes  = require('./routes')
1
Something is undefined, that is explicitly calling .prototype.... Double-check all the modules are installed, and then search your code for "prototype" (because likely these other packages aren't having this problem...) - clay

1 Answers

33
votes

If you want to use Express 4.x

change from

var express = require('express');
var RedisStore = require('connect-redis')(express);

to

var session = require('express-session')
var RedisStore = require('connect-redis')(session);

Also remember to install express-session:

npm install express-session --save

If you plan to use Express 3.x, pick compatible version 1.4.7 of connect-redis to avoid the error.

 npm install [email protected] --save

To get more information about migrating Express 3 to version 4: