Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting an error - Cannot find module 'express-session' #14

Open
dsm-kbl opened this issue Dec 11, 2014 · 3 comments
Open

Getting an error - Cannot find module 'express-session' #14

dsm-kbl opened this issue Dec 11, 2014 · 3 comments

Comments

@dsm-kbl
Copy link

dsm-kbl commented Dec 11, 2014

I am following the book and I get this error when I try to start my server. I tried to install the module express-session but doesn't work. It says

throw err;
Cannot find module 'express-session'

on this line - app.use(require('express-session')({ store : sessionStore }));

How can i solve this problem?

@EthanRBrown
Copy link
Owner

I just tried it and it worked fine for me. I have noticed two facts about npm that may help you. Sometimes there are temporary interruptions in the npm service, and sometimes just running npm install a second time will do the trick. Secondly, even though it shouldn't be necessary, I've had npm fail on me if I didn't run it with root privileges, so you might try sudo npm install as well. Let me know if either of these suggestions help....

@dsm-kbl
Copy link
Author

dsm-kbl commented Dec 16, 2014

Hi Ethan,
I just run npm install again and somehow it installed express-session. I got some warnings and now somehow i get a new error in this line.

app.use(vhost('api.*', rest.restler(apiOptions)));
TypeError: Object # has no method 'restler'

Any ideas?

@EthanRBrown
Copy link
Owner

I'm sorry its taken me so long to respond.... It looks like this is an obsolete use of the rest package...did you find that in the book or the repository?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants