mean-stripdown icon indicating copy to clipboard operation
mean-stripdown copied to clipboard

Express 4.x incompatibility

Open jmduke opened this issue 10 years ago • 5 comments

The sample app is incompatible with Express 4.x, which is unfortunate -- especially for newbies (like myself) who are greeted with strange errors as they first hit node server.

I'd argue there are two solutions:

  1. Update the package config to specify "express": "3.*"
  2. Actually make the thing up to date with Express 4.

I'd be willing to submit a PR for either.

jmduke avatar Apr 14 '14 21:04 jmduke

+1

tyrw avatar Jun 24 '14 15:06 tyrw

anyone feel like updating the express.js files? I might take a stab at it just for fun or heck say screw this stack and build it on mean.js stack

SOSANA avatar Aug 09 '14 04:08 SOSANA

same here

timebutler avatar Aug 12 '14 21:08 timebutler

jmduke, a little late to the party, but good call.

I was getting an error that basically meant that Express 4.x had stopped bundling the Middleware with the Express package.

The error linked me to https://github.com/senchalabs/connect, where I was confused even more.

Coming to this error thread, the Express version change worked perfectly for me.

  1. Enter your package.json file in edit mode.
  2. Change "express": "latest" to "express": "3"
  3. Save the file, run node server.
  4. Visit 127.0.0.1:3000, and you should see a page with a black header and welcome text.

Cmacca avatar Aug 18 '14 01:08 Cmacca

I tried changing the code to work with express 4.0. I installed all the packages from npm like body-parser, cookie-parser and so on. I "required" them in the code. Then changed the syntax from

app.use(express.bodyParser()) to app.use(bodyParser()) and similarly for other middleware.

Still I am getting the error for session, when I already did the process for express-session.

chintanp avatar Sep 04 '14 10:09 chintanp