How to Install Git and Node.js on macOS (Without Homebrew)

Posted on: April 30th, 2025
By: Tadeo Martinez

If you’re working on a Mac and want to set up Git, Node.js, and NPM without using Homebrew, this guide will walk you through it using official and lightweight methods.


✅ Step 1: Download & Install Xcode Command Line Tools

  1. Go to the official Apple Developer site:
    👉 https://developer.apple.com/download/all/?q=command%20line%20tools
  2. Sign in with your Apple ID (you’ll need a free Apple Developer account).
  3. Search for “Command Line Tools for Xcode” and select the version that matches your macOS (e.g., Command Line Tools for Xcode 15.3 (macOS 14.3)).
  4. Download the .dmg file.
  5. Open the .dmg and run the installer .pkg.
  6. Once installed, verify Git works: bashCopyEditgit --version ✅ You should see something like: git version 2.39.3

✅ Step 2: Install NVM (Node Version Manager)

  1. Open the Terminal app.
  2. Run the official NVM installation script: bashCopyEditcurl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
  3. After installation, manually create or update your .zshrc (or .bashrc if using Bash): bashCopyEdittouch ~/.zshrc open -e ~/.zshrc Add the following lines: bashCopyEditexport NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
  4. Save and close the file, then reload your terminal session: bashCopyEditsource ~/.zshrc
  5. Confirm nvm is working: bashCopyEditcommand -v nvm ✅ You should see: nvm

✅ Step 3: Install Node.js Using NVM

  1. Install a stable version of Node.js (recommended: Node 20): bashCopyEditnvm install 20
  2. Use it as your default version: bashCopyEditnvm use 20
  3. Confirm Node.js and NPM are working: bashCopyEditnode -v npm -v ✅ You should see versions like: CopyEditv20.x.x 10.x.x

✅ Bonus: Install GitHub SSH Key (Optional)

If you plan to use GitHub with SSH:

bashCopyEditssh-keygen -t ed25519 -C "your_email@example.com"
eval "$(ssh-agent -s)"
ssh-add --apple-use-keychain ~/.ssh/id_ed25519

Then copy your key:

bashCopyEditcat ~/.ssh/id_ed25519.pub

And paste it into GitHub under
👉 Settings → SSH and GPG keys → New SSH Key


🎉 You’re Done!

You now have:

  • ✅ Git installed via Xcode CLI tools
  • ✅ Node.js and NPM installed via NVM
  • ✅ A clean, non-Homebrew setup ready for web or software development

Have any questions or comments? Write them below!


Leave a Reply

Your email address will not be published. Required fields are marked *