SitePoint Sponsor |
|
User Tag List
Results 1 to 8 of 8
Hybrid View
-
Dec 26, 2012, 21:15 #1
- Join Date
- Dec 2006
- Location
- Toronto, Canada
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Can't get localhost:3000 and "Welcome to Express"
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)
Please help!
-
Dec 27, 2012, 09:34 #2
- Join Date
- Dec 2006
- Location
- Toronto, Canada
- Posts
- 2
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Solved. I configured db.js file and put the right versions according to package.json file.
It would be nice to have more detailed instructions in the book about setting up the environment.
-
Jan 3, 2013, 20:42 #3
- Join Date
- Jan 2013
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I'm having a similar problem... When I go to type node app, I get the following error.
Tylers-MacBook-Air:authentication tylerh$ node app
/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?
-
Jan 4, 2013, 03:31 #4
- Join Date
- Jan 2013
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Jan 5, 2013, 00:46 #5
- Join Date
- Nov 2012
- Posts
- 48
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
TylerH, if you are getting the welcome message it would seem to be some sort of DNS configuration issue and nothing to do with the Node.js side
-
Jan 5, 2013, 12:04 #6
- Join Date
- Jan 2013
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Hi Don, thanks for responding.
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
-
Jan 6, 2013, 00:03 #7
- Join Date
- Nov 2012
- Posts
- 48
- Mentioned
- 2 Post(s)
- Tagged
- 0 Thread(s)
What about http://127.0.0.1 does that work?
-
Jan 6, 2013, 12:49 #8
- Join Date
- Jan 2013
- Posts
- 4
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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