Video

Watch the full video on YouTube:

NestJS Requirements

What You Need to Build NestJS APIs

Before you write your first line of NestJS code, you need to set up your development environment. This guide covers every tool you will need and explains why each one matters.

Core Dependencies

Node.js

Node.js is the runtime environment that powers NestJS. It allows you to run JavaScript and TypeScript on the server. NestJS requires Node.js version 16 or higher, though using the latest LTS version is always recommended.

You can download Node.js from the official website:

https://nodejs.org

After installation, verify it works by running:

node --version
npm --version

Package Manager: pnpm

While NestJS works with npm and Yarn, pnpm is the recommended package manager for this series. pnpm is faster, more disk efficient, and has a stricter dependency resolution that helps catch issues early.

Install pnpm globally:

npm install -g pnpm

Verify the installation:

pnpm --version

Key advantages of pnpm over npm:

  • Disk efficiency: pnpm uses a content addressable store, so identical packages are never downloaded twice, even across different projects.
  • Speed: pnpm is significantly faster than npm for most operations, especially in CI environments.
  • Strictness: pnpm creates a more accurate node_modules structure that prevents accessing undeclared dependencies, catching import mistakes early.

Git

Git is the version control system you will use to track changes, collaborate with others, and deploy your application. Every NestJS project should be version controlled from day one.

Download Git from:

https://git-scm.com

After installation, configure your identity:

git config --global user.name "Your Name"
git config --global user.email "your.email@example.com"

Editor Options

VS Code

Visual Studio Code is the most popular editor for NestJS development. It has excellent TypeScript support, built in terminal, debugging, and a rich extension ecosystem.

Recommended extensions for NestJS:

  • NestJS Snippets: Provides code snippets for common NestJS patterns
  • Prettier: Automatic code formatting
  • ESLint: Linting for JavaScript and TypeScript
  • Thunder Client or REST Client: API testing from within the editor

Download VS Code from:

https://code.visualstudio.com

Zed

Zed is a modern, high performance code editor built in Rust. It launches instantly, has built in language servers, and supports collaborative editing out of the box. If you prefer a lightweight alternative to VS Code, Zed is worth trying.

Download Zed from:

https://zed.dev

Both editors provide excellent TypeScript support, integrated terminals, and Git integration. Choose the one that fits your workflow.

Additional Tools

Postman or Insomnia

While not strictly required, an API client like Postman or Insomnia is essential for testing your endpoints during development. These tools let you send HTTP requests, inspect responses, and save collections of API calls for later use.

A Terminal Emulator

A good terminal makes a significant difference in developer experience. Consider using:

  • Kitty: A GPU based terminal emulator that is fast and feature rich
  • iTerm2: The most popular terminal for macOS with split panes and profile management
  • Windows Terminal: Modern terminal for Windows with tab support and GPU acceleration

Setting Up Your Environment

Here is the recommended order for setting up your environment:

  1. Install Node.js
  2. Install pnpm: npm install -g pnpm
  3. Install Git
  4. Install your preferred editor (VS Code or Zed)
  5. Verify everything works:
node -v
pnpm -v
git --version
code --version   # for VS Code

Once all of these are installed and working, you are ready to create your first NestJS project.

Recommendations

This post is part of a NestJS API development series. Check out the other entries:

NestJS API Development Guide 01: What is NestJS?NestJS API Development Guide 03: First Project