Spring is here and soon that will mean being able to sit outside! For me that’s a good and a bad thing. Good because I love the outdoors, hiking, biking, golfing… bad because I love the outdoors, hiking , biking… you get what I mean. Spending time at the computer becomes harder for me as the weather warms up but I’ll keep at it, I hope you will too.
So I spent the first couple hours searching for a good Node.js for beginners tutorial and eventually I found Node.js Tutorial For Absolute Beginners from Traversy Media. Finally, a step by step tutorial that begins at the beginning and takes you through Node and Mongodb (a database) one step at a time. Of course I’m no expert and I hope my understanding of Node.js for this post is correct and help’s rather than hinders other Newbies avoid my experience, but here’s a short summary about Node.js which I suggest you follow up by watching Node.js Tutorial For Absolute Beginners and then if you’re still interested try Node.js & Express From Scratch a 12 part video tutorial series also from Traversy Media which I haven’t gotten to yet but looks like it follows in the same style as the other two videos.
Node is an an event-driven, non-blocking I/O model which means it doesn’t handle one request at a time and wait until the data comes back before handling the next request. Instead it takes the request and puts it aside while the computer puts together the data requested, moving on to the next request. For a better explanation watch the first 10 minutes of Node.js Tutorial for Beginners: Learn Node in 1 Hour.
I’ll end this post with one piece of very important advice. When you install Node.js or any or its add-ons like Express. First, before you do any installing, make sure you launch your cmd line app as the ADMINISTRATOR (right click on your menu and select ‘run as administrator’). The tutorials do say to do this but I didn’t take notice. Not once but about three times! I installed node, started the server and got “This site can’t be reached localhost refused to connect” each time. Deleted the whole installation and started again. Finally I noticed the cmd line app the instructor was using said Administrator right there on the app header. DOH! lol Well one thing about being self taught, after you spend hours trying to solve a problem, when you find the solution and its your own fault… you won’t make that mistake again! Launched the app as administrator, installed node and express, launched the server! Success!
Oh, and if you’re installing Node.js 3.6 or later… the command REST? just ignore it… leave it out, and all will be fine. 🙂
Till next time!