angular-express-seed icon indicating copy to clipboard operation
angular-express-seed copied to clipboard

Update middleware "errorhandler" to the Express 4.x new style

Open loic-moriame opened this issue 11 years ago • 7 comments

Replace the old middleware "error-handler" by the new one "errorhandler" Now the command line node app.js just work like a charm !

I also add a simple .gitignore file to exclude "node_modules" folder : I guess is best for a seed Node.js project

loic-moriame avatar May 25 '14 22:05 loic-moriame

Can confirm both the issue and this fix.

Cloned seed, ran npm install and node app.js returned:

Error: Most middleware (like errorHandler) 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/melo/projects/experiments/web/ang-exp-btford-example/node_modules/express/lib/express.js:89:13)
    at Object.<anonymous> (/home/melo/projects/experiments/web/ang-exp-btford-example/app.js:36:19)
    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)
    at startup (node.js:119:16)
    at node.js:906:3

Applied moriame's patches to package.json and app.js, ran npm install again and after that node app.js starts without issues. Thanks @moriame !

melo0187 avatar May 28 '14 14:05 melo0187

That's right. The latest commit have not get change the app.use(errorHandler());

gu-fan avatar Jul 09 '14 14:07 gu-fan

I get this error as well, any chance of a fix?

jamesmorgan avatar Jul 24 '14 21:07 jamesmorgan

Had the same problem. The proposed solution works like a charm. Thanks for it! Please merge this pull request.

Doogiemuc avatar Dec 14 '14 13:12 Doogiemuc

Thanks for this! Still an issue as not yet merged, but straightforward to make the change manually.

CplSyx avatar Mar 23 '15 22:03 CplSyx

Thanks, fixed it for me too! Should be merged into master.

mattklein999 avatar Apr 03 '15 19:04 mattklein999

Please merge ... Fix is needed :+1:

toome123 avatar Jun 17 '15 11:06 toome123