Learnr

Learn Node.js

Run JavaScript on the server and build your own APIs.

or browse all courses.

Free to start. Built from a single prompt. No credit card.

Node.js is a runtime that lets JavaScript run outside the browser, built on the V8 engine from Chrome. It uses an event loop and non-blocking I/O, so a single process can handle many network connections while waiting on files or databases. Developers use it for web servers and APIs, command-line tools, build tooling and real-time apps like chat. Its package manager, npm, hosts a vast library ecosystem. Beginners learn modules, the file system and HTTP, then frameworks like Express. Learnr builds a personalized Node.js course from your prompt and teaches it through short, interactive lessons that end in a working API.

How to learn Node.js, step by step

  1. Install Node.js and run a script. Install the current LTS release from nodejs.org or with a version manager like nvm, then run node app.js. Note that there is no window or document object; Node has process, the file system and the network instead.
  2. Learn npm and modules. Create a project with npm init, install a package, and look at package.json and package-lock.json. Use import and export with ES modules, and know you will see older require code too.
  3. Understand the event loop and async. Read files with fs/promises using async and await, and see how a slow synchronous call blocks every request. Understanding this is the key to writing Node code that scales.
  4. Build an HTTP server, then an Express API. Create a raw server with the http module once, then build a REST API in Express with routes for create, read, update and delete, plus JSON body parsing and error-handling middleware.
  5. Add a database and configuration. Connect to PostgreSQL, MongoDB or SQLite, validate request bodies, and keep secrets in environment variables loaded from a .env file that stays out of Git.
  6. Test and deploy your API. Write tests with the built-in node:test runner or a library like Vitest, then deploy to a platform that runs Node servers. Short Learnr lessons help keep async patterns and Express basics fresh.

What you'll learn

  • Explain the event loop and non-blocking I/O
  • Manage projects and dependencies with npm and package.json
  • Use ES modules and built-in modules like fs, path and http
  • Build a REST API with Express, routing and middleware
  • Connect to a database and handle errors and environment variables

What's inside your Node.js course

A sample path Learnr builds for Node.js. Your real course adapts to your goal and level.

  • 1. What Node.js is and how it differs from the browser
  • 2. Modules, npm and package.json
  • 3. Files, streams and the event loop
  • 4. HTTP servers and Express
  • 5. Databases, validation and error handling
  • 6. Testing, environment config and deployment

How long does it take to learn Node.js?

If you already know JavaScript, the Node basics take 2 to 4 weeks, and a working Express API with a database takes about 2 to 3 months at 5 to 8 hours a week. Learning JavaScript first adds a few months.

What you need before you start

Comfortable JavaScript, especially functions, objects, modules, promises and async and await. Basic command-line use and a rough idea of HTTP requests and JSON.

Common mistakes to avoid

  • Using synchronous functions like readFileSync inside request handlers, which blocks every other request. Use the async versions in server code.
  • Forgetting to handle promise rejections, so errors vanish or crash the process. Use try and catch around awaited calls and add error-handling middleware.
  • Committing node_modules or .env files to Git. Add both to .gitignore and reinstall dependencies from package.json.

How Learnr builds your course

Type your topic

Tell Learnr you want to learn Node.js, or get as specific as you like.

Get a personalized course

Learnr instantly builds a full Node.js course tailored to your goal and skill level.

Learn and level up

Move through bite-sized lessons and interactive practice, earning XP and keeping your streak.

Node.js questions, answered

Is Node.js a programming language?

No. Node.js is a runtime environment that executes JavaScript on servers and computers. The language is JavaScript; Node supplies APIs for files, networking and processes.

Should I learn Node.js or Python for the back end?

Both are good choices. Node lets you use JavaScript across front end and back end, while Python with Django or Flask is strong for data-heavy work and readability.

What is Express?

Express is a minimal web framework for Node.js that provides routing and middleware, making it straightforward to build APIs and web servers. It is a common first framework for Node learners.

Explore more courses

More programming and tech courses

See all programming and tech courses

Ready to learn Node.js?

Start your free, personalized Node.js course in seconds. .