Open tamitutor opened 11 years ago
It looks like you might be using an old version of express that doesn't expose the express app prototype that way that express-expose expects. If you upgrade to express 3 this should fix itself.
According to express-expose
Readme.md, latest express-expose@0.3.4
is only compatible with express@4.x
:
express@4.x
(use express-expose
at >= 0.3.4
)express@3.x
(use express-expose
at >= 0.2.3
and <= 0.3.3
)express@2.x
(use express-expose
at <= 0.2.2
)Using the same patch version for different major releases of express
seems like a violation of Semantic Versioning to me.
@lbeschastny pull request welcome
@niftylettuce I don't think that anything could be done about express@2.x
/express@3.x
.
As for express@3.x
/express@4.x
, you could re-release latest express-expose
under 0.4.0
version, marking current express-expose@0.3.4
release as deprecated (or even unpublishing it). It'll resolve all versioning problems for express@3.x
users.
As for pull-request
, maintiners usually don't like contributors messing with package version, but if you want, I'll create one. Though, it'll be pointless without either deprecating or unpublishing current express-expose@0.3.4
release.
My code for requiring expose looks like this:
------------------BEGIN CODE--------------------- var express = require('express') , expose = require('express-expose') , program = require('commander') , cookie = require('cookie') , routes = require('./routes') , api = require('./routes/api.js') , passport = require('passport') , BasicStrategy = require('passport-http').BasicStrategy , config = require('config') ;
program .version('0.0.1') .option('-t, --test', 'Run as a test') .parse(process.argv);
var app = module.exports = express.createServer(); ------------------END CODE---------------------
The specific line in express-expose.js throwing the error is line 44.
Please see the attached image...