app.address does not exist
$ npm list express
npm WARN ls doesn't take positional args. Try the 'search' command
[email protected] /Users/btakita/workspace/garland-express
├── [email protected] extraneous
├─┬ [email protected] invalid
│ ├── [email protected]
│ ├─┬ [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ ├── [email protected]
│ │ └── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ ├── [email protected]
│ └── [email protected]
├─┬ [email protected] extraneous
│ ├─┬ [email protected]
│ │ └── [email protected]
│ └── [email protected]
├── [email protected]
└── [email protected]
This is from a fresh run of
express --template mustache -c sass -s
$ node app.js
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object function app(req, res){ app.handle(req, res); } has no method 'address'
at Server.<anonymous> (/Users/btakita/workspace/garland-express/app.js:37:69)
at Server.g (events.js:156:14)
at Server.emit (events.js:64:17)
at Array.0 (net.js:777:10)
at EventEmitter._tickCallback (node.js:192:40)
hmm it shouldn't be generating anything with app.address(), try maybe updating again with npm install -g express
I have the exact same error. btakita, did you ever resolve this issue?
in express 2.x I have been using app.address().port to display the port that is in use, now in 3.x I also get the error message has no method 'address'
var server = http.createServer(app); server.address() - express "apps" are no longer servers, just functions
check out the migration guide in the wiki
The migration guide doesn't mention any "address()" method ?
.address() is a node thing, but yeah I get asked that a lot i'll add something to the migration guide