after typing "node app" in command line, I got following:
Express server listening on port 3000 in development mode
/Library/WebServer/Documents/node.js/book/chapter01/authentication/node_modules/mongoose/lib/utils.js:413
throw err;
^
Error: Uncaught, unspecified 'error' event.
at NativeConnection.EventEmitter.emit (events.js:73:15)
at Model.init (/Library/WebServer/Documents/node.js/book/chapter01/authentication/node_modules/mongoose/lib/model.js:554:31)
at exports.tick (/Library/WebServer/Documents/node.js/book/chapter01/authentication/node_modules/mongoose/lib/utils.js:408:16)
at Db.ensureIndex (/Library/WebServer/Documents/node.js/book/chapter01/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1066:28)
at Db.indexInformation (/Library/WebServer/Documents/node.js/book/chapter01/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/db.js:1200:28)
at Cursor.toArray (/Library/WebServer/Documents/node.js/book/chapter01/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:124:30)
at Cursor.each (/Library/WebServer/Documents/node.js/book/chapter01/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:166:32)
at Cursor.nextObject.self.queryRun (/Library/WebServer/Documents/node.js/book/chapter01/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:441:39)
at Cursor.close (/Library/WebServer/Documents/node.js/book/chapter01/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:687:5)
at Cursor.nextObject.commandHandler (/Library/WebServer/Documents/node.js/book/chapter01/authentication/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:441:21)
/Users/tylerh/authentication/app.js:35
.log("Express server listening on port %d in %s mode", app.address().port, app
^
TypeError: Cannot read property 'port' of null
at Object.<anonymous> (/Users/tylerh/authentication/app.js:35:76)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
Does anyone have suggestions for how to troubleshoot this?
Okay... not sure where the mix up happened, but was excited to figure it out.
I found I finally got to the point where I was receiving another error, that commenting on the actually app.js file not working. Googling the error got me to this page: http://stackoverflow.com/questions/1...o-method-flash
So I added connect-flash to node.
However localhost:3000 still doesn't come up with anything.
But now if I visit http://0.0.0.0:3000 instead, it shows the "Express Hello World" message.
Not really sure what the issue is, I've been scouring stackoverflow for people having similar problems but not having much luck. I kept moving on and got to the form submission part, which I don't know that problem is causing the error now but the signup form submits now (http://0.0.0.0:3000/form) but just cycles through until it eventually times out without giving a real error.
I'll post the solution when I find it.
Last edited by TylerH; Jan 5, 2013 at 12:11.
Reason: Was unclear about my position in the book in the first edit
Okay, kind of an obscure issue but I figured it out. The form now posts using the 0.0.0... address as well as the 127.0.0.1 the actual problem though wasn't any of that.
I compared my files with someone else who had a working example, and found that they had a simple alphanumeric password. I was using an '@' symbol in my password. So I dumbed down my mongo database username and password to just being test/test... (Super secure) but yeah now it connects.
So the lesson here was not to include the @ symbol in your passwords?
Hope that help someone else, I know I lost three days from just that.
Thanks again Don for offering advice!
Last edited by TylerH; Jan 6, 2013 at 12:51.
Reason: missing word in one of my senctences
Bookmarks