Prerequisites
Development environment setup
Introduction#
The purpose of this lesson is to guide learners through the initial setup process of a Node.js development environment. This includes the installation of essential tools required for a seamless coding experience. Some of the tools that will be installed and discussed include Node.js
, npm
, Git
, MongoDB
, Docker
, a code editor, and a REST client. It is important to note that a basic understanding of JavaScript, including concepts such as variables, functions, objects, and arrays, is assumed as this article does not cover JavaScript fundamentals.
Setting Up Node.js and npm#
Node.js
is a fundamental part of modern web development and is the first thing that needs to be set up. Node.js can be downloaded from nodejs.org. For the examples in this article, we will be using Node
version 20.0.0. If the reader doesn't already have it, they should download and install it. Once Node.js
is set up correctly, npm
, the Node package manager, comes bundled with it. The installations can be verified by running node -v
and npm -v
in the terminal. This will display the versions of Node.js
and npm
installed on the machine.


Managing Node.js Versions with nvm#
When working on several projects, it might be necessary to switch between different Node.js
versions. Node Version Manager (nvm)
is an excellent tool for this purpose. It allows for easy installation, management, and switching between Node.js
versions on the machine. nvm
can be downloaded from nvm.sh. To check if nvm
is installed, run nvm -v
in the terminal.

Git#
Git is a very popular distributed version control system that keeps a history of our code changes. We'll use Git to allow multiple contributors to work on a single codebase, and as a way to communicate with GitHub.
This lesson preview is part of the Pain Free Mocking with Jest course and can be unlocked immediately with a \newline Pro subscription or a single-time purchase. Already have access to this course? Log in here.
Get unlimited access to Pain Free Mocking with Jest, plus 70+ \newline books, guides and courses with the \newline Pro subscription.

[00:00 - 00:16] Let's get started by reviewing what you need to setup first before we dive into coding. The first thing is to have Node.js and npm installed. I'll be using Node version 20.0.0 in my examples. So I'd recommend downloading and installing that if you don't already have it.
[00:17 - 01:56] Once node is setup, you automatically have npm as well. To download Node.js you can head over to node.js.org and click it off these big green buttons. This is for the long- time version and this is for the latest version. You can also head over to the download section and download the installer for your respective operating system. You can check which Node.js version you have installed by running node.v. I'll do the same for npm using npm.v. A great tool for managing multiple Node.js versions is Node version manager. It allows you to easily switch between node versions on your machine for different projects. I'd recommend installing and using npm too. To download npm, head over to mvm.sh which will redirect you to this GitHub repository and in here you have the installation instructions. To check if mvm is installed, run mvm.v. mvm lets you easily install and manage different Node.js versions on your machine. Some useful mvm commands are mvm install. To install a specific version mvm use to use a version mvm list to view installed versions and lastly mvm alias to set a version to the default. Next you will need to install mongo db. We'll be using mongo db as our persistence store so you need to have that downloaded and running locally.
[01:57 - 02:35] We'll be using mongo db community server. This community addition is free and open source for development and production environments. While just doesn't require docker to run, in the later part of this course, we'll use test containers which relies on docker. You can download docker desktop installer at docker.com/products/docker-dexstop. We'll need to make use of a code editor. I use Visual Studio code because it has fantastic syntax highlighting and supports debugging which will come in handy.
[02:36 - 03:02] But feel free to use whatever editor you prefer like Atom or Sublime as long as it supports JavaScript. To download Visual Studio code, head over to code.vigionsstudio.com and you can download the installer for your operating system. For making API requests, I will be using a Visual Studio code extension called REST API client. For tools like Postman or Insomniac will work great too.
[03:03 - 03:40] Having a REST client will allow us to test APIs directly. And finally, you should feel comfortable with JavaScript basics like variables, functions, objects and arrays. We won't be teaching JavaScript fundamentals in this course, but you'll need to have an understanding of the syntax. So in summary, you need to have Node, npm, MongoDB, docker, a code editor and a REST client. Make sure you have everything installed so you can follow along with the examples. See you in the next lesson.