Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find module 'express-session'

Tags:

node.js

redis

I am trying to run sparkleshare-dashboard. This is an open source project you can see it here https://github.com/tommyd3mdi/sparkleshare-dashboard.

The project use Node.JS and Redis and i have no experience with both. I did setup the environment as described in the help file and then i try to run file app.js from command line using 'node' command but i got this error.

Error: Cannot find module 'express-session'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (E:\Imports\sparkleshare-dashboard\app.js:5:15)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)

Maybe i didn't provide enough information but i am expecting that may be some of you guys has done some work on sparkleshare project and may someone can help me in this.

like image 465
umerk44 Avatar asked Dec 20 '22 17:12

umerk44


1 Answers

The reason is likely your ">" operator for express in the package.json. Express 4.0 is out now and the complete middleware concept changed. You need to install these middlewares manually. "express-session" is one of the 4.0 middlewares.

I recommend to read

http://scotch.io/bar-talk/expressjs-4-0-new-features-and-upgrading-from-3-0 and https://github.com/visionmedia/express/wiki/Migrating-from-3.x-to-4.x

Additionally some users were confused that the github repo is named just "session" but

npm install express-session

is correct.

like image 56
sebilasse Avatar answered Jan 06 '23 11:01

sebilasse