Peer5 / ShareFest

Web based p2p file sharing built on WebRTC Data Channels API
1.68k stars 271 forks source link

Error when running #82

Open joshterrill opened 9 years ago

joshterrill commented 9 years ago
> node sharefest/server.js
/home/nitrous/ShareFest/node_modules/express/lib/express.js:99
      throw new Error('Most middleware (like ' + name + ') is no longer bundle
            ^
Error: Most middleware (like json) is no longer bundled with Express and must be installed separately. Please see https://github.com/senchalabs/connect#middleware.
    at Function.Object.defineProperty.get (/home/nitrous/ShareFest/node_modules/express/lib/express.js:99:13)
    at Object.<anonymous> (/home/nitrous/ShareFest/sharefest/server.js:27:16)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3
npm ERR! Linux 3.16.0-34-generic
npm ERR! argv "node" "/usr/local/opt/nvm/versions/node/v0.12.5/bin/npm" "start"
npm ERR! node v0.12.5
npm ERR! npm  v2.11.3
npm ERR! code ELIFECYCLE
npm ERR! Sharefest@1.0.0 start: `node sharefest/server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Sharefest@1.0.0 start script 'node sharefest/server.js'.
npm ERR! This is most likely a problem with the Sharefest package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node sharefest/server.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls Sharefest
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /home/nitrous/ShareFest/npm-debug.log

Seems like something is wrong with the middleware.

saurabhghewari commented 9 years ago

I came across same issue. I resolved this by following these steps.

First of all remove express folder from Sharefest/node_modules/express Then install express 4.13.x. comment out these lines from server.js // app.use(express.json()); // app.use(compression()); Replace from server.js app.configure('development', function () { app.configure('production', function () { with if (app.get('env') === 'development') { if (app.get('env') === 'production') { Respectively. Now Replace all of these lines from server/lib/router.js res.send(statusCode, resObject); with res.status(statusCode).send(resObject); Now Replace these lines from server/lib/router.js res.sendfile() with res.sendFile();

lilmike commented 8 years ago

Any news on this issue? Would be interested in hearing, as I'm also having this problem. -Michael.

AJ-Acevedo commented 7 years ago

Has this project been abandoned?