Hello NodeJS | Installation

Welcome to this introduction to NodeJS! In the following chapters I covered all the basics you need to get started in development for NodeJS. I tried to be as precise as possible, leaving out all the cluttering bells and whistles in an attempt to give you a clear view of only the important parts.

Here’s what you’re up for:

  1. Installation
  2. Hello World
  3. The Package Manager
  4. Hello World - The Next Level
  5. Project Structure
  6. Working With HTML
  7. Adding CSS and JavaScript
  8. Basic Routing
  9. User Input
  10. Advanced Routing
  11. Controllers
  12. Organizing Views
  13. Templates
  14. Sessions
  15. Databases
  16. Mongoose
  17. Authentication With PassportJS
  18. Conclusion

Let’s start at the beginning: Installing NodeJS on our system (I’m working with Ubuntu here, commands might differ depending on your distribution). Since the package in the official repository isn’t always up-to-date, we have to get the latest version using this command:

1
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

This will install the current version:

1
sudo apt-get install -y nodejs

Now we need a folder to give our project a home. You can obviously call it whatever you like, I will be using node_tutorial

1
mkdir node_tutorial