Free Online Course · Self-paced

Node.js Tutorial for Beginners (Hands-On)

Free, hands-on Node.js tutorial - installation, REPL, file system, child processes, Express, MongoDB, authentication, error handling, debugging, and HTTPS. 35+ runnable lessons.

  • 60 parts
  • ~378 min total
  • Beginner to Intermediate
  • Updated May 2026
Node.js Tutorial for Beginners (Hands-On)
By Last updated

Node.js is the most-deployed JavaScript runtime outside the browser, and Express is the most-used framework on top of it. This tutorial walks you through Node.js the way you will actually use it - file system, child processes, HTTP servers, async patterns, Express APIs, MongoDB integration, debugging, and deployment.

We start with installation and the REPL, then move through the file system (because every Node.js script eventually reads a file), async patterns (callbacks, promises, async/await, loops without footguns), HTTP/HTTPS servers, Express + database integration (MongoDB + Mongoose, MySQL), and finally testing, debugging, and Heroku deployment. Every example is a small, runnable snippet you can paste into a fresh node REPL.

Click Start the course to begin with installation, or jump to the chapter you need - Async Patterns and Express and Databases are the most-bookmarked.

What you'll learn

  • Install Node.js on any OS and understand the runtime, REPL, and global objects
  • Read and write files asynchronously, traverse directories, and spawn child processes
  • Build HTTP servers, REST APIs, and HTTPS endpoints with the built-in modules and Express
  • Handle async patterns (callbacks, promises, async/await, async loops) without footguns
  • Build a CMS with Express + MongoDB, authenticate users with Passport, and paginate large collections
  • Debug and troubleshoot the most common Node.js errors

Prerequisites

  • JavaScript fundamentals (variables, functions, callbacks, promises, async/await)
  • Comfortable on the command line
  • Node.js LTS installed (use nvm where possible)
  • Optional - MongoDB or MySQL for the database chapters

Syllabus

11 chapters · 60 lessons · ~378 min of reading

  1. 1 Installation and First Steps 7 lessons
    1. Part 1 Install Node.js on Ubuntu 20.04 5 min read
    2. Part 2 How to use the Node.js REPL 7 min read
    3. Part 3 Run the REPL inside a function 6 min read
    4. Part 4 Node.js global objects explained 6 min read
    5. Part 5 Read environment variables 5 min read
    6. Part 6 Pass arguments to an npm script 4 min read
    7. Part 7 println() equivalent in Node.js 4 min read
  2. 2 Editor Setup 4 lessons
    1. Part 8 Set up Node.js with VS Code 7 min read
    2. Part 9 Set up Node.js with Eclipse IDE 6 min read
    3. Part 10 Set up Node.js with Atom IDE 5 min read
    4. Part 11 Set up Node.js with Sublime Text 5 min read
  3. 3 File System 11 lessons
    1. Part 12 Create a directory if it doesn't exist 5 min read
    2. Part 13 Check if a file or directory exists 5 min read
    3. Part 14 List all files in a directory 6 min read
    4. Part 15 List files recursively 6 min read
    5. Part 16 Loop through files in a directory 7 min read
    6. Part 17 Read JSON files 6 min read
    7. Part 18 Write a file 7 min read
    8. Part 19 Get the current working directory 4 min read
    9. Part 20 Get the script's own directory path 5 min read
    10. Part 21 Check if a path is a subdirectory of another 6 min read
    11. Part 22 Parse CSV data 6 min read
  4. 4 Async Patterns (callbacks, promises, async/await) 9 lessons
    1. Part 23 forEach in Node.js 6 min read
    2. Part 24 Loop through an array 6 min read
    3. Part 25 Async for loop in Node.js 7 min read
    4. Part 26 Async while loop 7 min read
    5. Part 27 Wait for a loop to finish before continuing 4 min read
    6. Part 28 Is Node.js single-threaded? 6 min read
    7. Part 29 Multithreading with worker threads 7 min read
    8. Part 30 Sleep / delay in Node.js 12 min read
    9. Part 31 Create a 10-second timer 6 min read
  5. 5 HTTP, HTTPS and Networking 4 lessons
    1. Part 32 HTTP GET request in Node.js 5 min read
    2. Part 33 Create an HTTPS server 5 min read
    3. Part 34 Fetch and serve images 5 min read
    4. Part 35 Monitor HTTPS traffic 6 min read
  6. 6 Express and Databases 6 lessons
    1. Part 36 Read POST body data in Express 11 min read
    2. Part 37 Handle file uploads 7 min read
    3. Part 38 Build a CMS with Express + MongoDB 6 min read
    4. Part 39 Paginate with Mongoose 6 min read
    5. Part 40 Save form data to MySQL 6 min read
    6. Part 41 Authenticate users with Passport.js 10 min read
  7. 7 Child Processes and System 1 lesson
    1. Part 42 Child processes in Node.js 6 min read
  8. 8 Strings, Objects, Arrays 8 lessons
    1. Part 43 Base64 encode and decode 8 min read
    2. Part 44 Log a full object (no truncation) 6 min read
    3. Part 45 Map function for objects 6 min read
    4. Part 46 Update a key with a new value 4 min read
    5. Part 47 Add items to an array 4 min read
    6. Part 48 Sort a Map by value 7 min read
    7. Part 49 Generate a unique ID (UUID) 12 min read
    8. Part 50 Node.js Date constructor 6 min read
  9. 9 Error Handling, Debugging and Common Errors 6 lessons
    1. Part 51 Node.js error handling patterns 6 min read
    2. Part 52 try / catch / finally in Node.js 6 min read
    3. Part 53 Debugging tips and tricks 10 min read
    4. Part 54 Fix: Cannot find module 12 min read
    5. Part 55 Fix: Cannot find module 'express' 3 min read
    6. Part 56 Fix: Cannot find module 'glob' 6 min read
  10. 10 Testing and Heroku Deployment 3 lessons
    1. Part 57 assert module examples 6 min read
    2. Part 58 assertEquals in JavaScript 6 min read
    3. Part 59 Deploy Node.js to Heroku from scratch 7 min read
  11. 11 Working with jQuery (server-side rendering) 1 lesson
    1. Part 60 Use jQuery on the server side 6 min read
Deepak Prasad

R&D Engineer

Founder of GoLinuxCloud with over a decade of expertise in Linux, Python, Go, Laravel, DevOps, Kubernetes, Git, Shell scripting, OpenShift, AWS, Networking, and Security. With extensive experience, he excels across development, DevOps, …

  • Red Hat Certified System Administrator in Red Hat OpenStack
  • Certified Kubernetes Application Developer (CKAD)
  • Red Hat Certified Specialist in Ansible Automation
  • Go (programming language)
  • Python (programming language)
  • DevOps
  • Computer Security