DEV Community

Cover image for Setting Up Your macOS Dev Environment for Node.js & Express (The Right Way)
Bello Osagie
Bello Osagie

Posted on • Edited on

Setting Up Your macOS Dev Environment for Node.js & Express (The Right Way)

This is Part 1 of my Express.js Series — setting up a solid foundation before we start writing any backend code.

Whether you're a beginner diving into backend development or an experienced dev ready to streamline your setup, this guide walks you through a clean, scalable macOS development environment tailored for Node.js and Express.


Why the Setup Matters

Before jumping into building APIs with Express.js, it's important to ensure your environment is clean, consistent, and developer-friendly.

Instead of installing everything manually from random websites, we’ll leverage tools like Homebrew, NVM, and VS Code extensions — automating the process and making it repeatable.


What We're Setting Up

By the end of this setup, you’ll have:

  • Homebrew managing your dev tools
  • Node.js versions managed cleanly via NVM
  • A curated VS Code setup with key extensions
  • MongoDB tools and CLI
  • Git, Postman, Arc, Warp Terminal, and more

Two Ways to Install Software

When it comes to installing tools on macOS, you have two main choices:

  1. Traditional GUI Installers
    Downloading installers from each software’s website (e.g., vscode.dev, postman.com)

  2. Command-Line Install with Homebrew
    Automating setup with brew, brew cask, and even managing VS Code extensions

I prefer Homebrew, especially for developers, because it makes your setup easier to track, reproduce, and maintain.


Installing Homebrew

If you haven't already installed Homebrew, use this one-liner in your terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Enter fullscreen mode Exit fullscreen mode

Setting Up with a Brewfile

We’re using a Brewfile to install all our tools in one shot. You can create one at:

~/Documents/express-app/config/macOS/Brewfile
Enter fullscreen mode Exit fullscreen mode

Paste this into the file:

brew "gh"
brew "git"
brew "mongodb-community@6.0"
brew "mongodb-atlas-cli"
brew "oven-sh/bun/bun"
brew "mongodb/brew/mongosh"

cask "amazon-q"
cask "postman"
cask "arc"
cask "visual-studio-code"
cask "warp"
cask "mongodb-compass"

vscode "mongodb.mongodb-vscode"
vscode "bengreenier.vscode-node-readme"
vscode "yzhang.markdown-all-in-one"
vscode "Postman.postman-for-vscode"
vscode "esbenp.prettier-vscode"
vscode "GitHub.github-vscode-theme"
vscode "PKief.material-icon-theme"
vscode "biomejs.biome"
vscode "AmazonWebServices.amazon-q-vscode"
Enter fullscreen mode Exit fullscreen mode

Then run:

brew bundle --file=~/Documents/express-app/config/macOS/Brewfile
Enter fullscreen mode Exit fullscreen mode

This installs all listed apps, CLI tools, and VS Code extensions.


Fixing Node.js the Smart Way: Use NVM

Why not just use the global Node installation?

Tools like MongoDB CLIs often install Node.js as a dependency. But that’s not ideal. You don’t want multiple tools messing with global Node.

Here's what I did:

1. Uninstall Node via Brew:

brew uninstall node
Enter fullscreen mode Exit fullscreen mode

2. Install NVM (Node Version Manager):

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

Then restart your terminal or run:

export NVM_DIR="$HOME/.nvm"
source "$NVM_DIR/nvm.sh"
Enter fullscreen mode Exit fullscreen mode

3. Use NVM to manage Node:

nvm install node       # Installs latest version
nvm use node
nvm ls                 # Lists installed versions
nvm alias default node # Sets default
nvm uninstall 20       # Example: Uninstalls a version
Enter fullscreen mode Exit fullscreen mode

Now you're in full control of your Node versions—perfect for development and debugging.


Recap: Tools We Installed

Tool Purpose
VS Code Code editor
Arc & Warp Modern browsers/terminals
Git & GitHub CLI Version control
MongoDB tools Database management
Postman API testing
Amazon Q AI pair programmer
Bun JS runtime alternative
NVM Node version management

Watch the Video Tutorial

If you prefer to follow along visually, check out the video that walks through this exact setup step-by-step:

Watch on YouTube


What's Next?

In the next episode, we’ll initialize our Express.js project and start building real APIs!

Make sure you subscribe to stay updated and follow along.


Feedback?

Drop a comment below or on the video if you ran into any issues or want to recommend more tools for the setup!

Top comments (0)