h5bp / server-configs-node

Express / Connect middleware for websites. Goes well with HTML5 Boilerplate.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot find module "express/node_modules/send"

BrentonCozby opened this issue · comments

When starting my application that uses express and h5bp as express middleware:

Error: Cannot find module 'express/node_modules/send'
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/brenton/Code/Projects/timestamper-fcc/node_modules/h5bp/lib/layers/headers.js:6:45)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

Hi, which version of express are you using?

4.14.0. I'm using it in an app created by express-generator and it's the first middleware. App works when I comment out the h5bp middleware.

This middleware is unfortunately only compatible with express 3.x. 4.x brings breaking changes that probably prevent h5bp to function properly. You can either downgrade express or choose another middleware. Sorry about this, I will add it as a peer dependency.

hi, just trying this out and going through the issue list.
so it turns out you need express@3.0.0? ok, so i tried that and installing h5bp@0.1.3 (which requires a native compilation that fails).

could you perhaps put this into a Docker container or try it out on a new machine so that i remain sane.

ta,

TBH, h5bp is unfortunately deprecated now, and I'm thinking about a complete rewrite that makes more sense for nowadays node servers. I will be keen on investing time on this instead of debugging the old codebase.

@mbana What features do you need from this module?

hi, you're linked to on this page:

https://developers.google.com/web/fundamentals/performance/optimizing-content-efficiency/http-caching

Note: Tip: The HTML5 Boilerplate project contains sample configuration files for all the most popular servers with detailed comments for each configuration flag and setting. Find your favorite server in the list, look for the appropriate settings, and copy/confirm that your server is configured with the recommended settings.

can you then please update the README as other people might try to do the same.

ta,

@mbana Thanks for the info. I will mention it.