dev/notes

Spot a mistake? Highlight any text in a post and click Report — it goes straight to the author.

beginner · Development Environment · August 17, 2026 · 2 min read

How to Set Up a Modern JavaScript Development Environment

Learn how to set up Node.js, Git, and VS Code from scratch. A step-by-step guide to a modern JavaScript development environment in under 30 minutes.

What you’re building

Every JavaScript project starts with the same three tools: Node.js to run code, Git to version it, and an editor such as VS Code to write it. Set them up once and every project after that is faster.

This guide walks through a clean, minimal setup on macOS, Windows, and Linux — no guesswork, no cargo-culting.

Prerequisites

  • A computer with an internet connection
  • A terminal (Terminal.app, PowerShell, or your shell of choice)
  • 10–30 minutes

Step 1 — Install Node.js

Use a version manager instead of the raw installer so you can switch Node versions per project.

macOS / Linux — nvm:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
# restart your terminal, then:
nvm install --lts
nvm use --lts

Windows — nvm-windows: download the installer from the nvm-windows releases, then run:

nvm install lts
nvm use lts

Verify with:

node -v   # v22.x
npm -v    # 10.x

Step 2 — Install and configure Git

Install:

  • macOS: xcode-select --install (or brew install git)
  • Windows: git-scm.com
  • Linux: sudo apt install git / sudo dnf install git

Configure your identity — this is what shows up on every commit:

git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --global init.defaultBranch main

Step 3 — Install VS Code

Download from code.visualstudio.com and install. Add the shell command so you can open a folder from the terminal:

  1. Open VS Code, press Cmd/Ctrl + Shift + P.
  2. Run Shell Command: Install ‘code’ command in PATH.
  3. From any folder: code . opens it in the editor.

Step 4 — Prove the whole stack works

mkdir hello-js && cd hello-js
npm init -y
echo 'console.log("hello devnotes");' > index.js
node index.js
git init
git add . && git commit -m "Initial commit"

If hello devnotes printed and the commit succeeded, your environment is ready.

Troubleshooting

  • node: command not found — your version manager didn’t modify PATH. Restart the terminal, or check the install logs for the required PATH line.
  • git still uses an old branch namegit config --global init.defaultBranch main only affects new repos; rename an existing one with git branch -m main.
  • code isn’t found — re-run the “Install ‘code’ command in PATH” step and restart the terminal.

Summary

You now have a reproducible JavaScript environment: a version-managed Node, a configured Git, and VS Code wired into your terminal. Next steps: set up your first GitHub repo, or configure VS Code for web development.

Related posts

Comments

One comment per thread every 30 minutes · edits are unlimited.