Install Node.js on macOS
Using Homebrew (Recommended)
bash
# Install Homebrew if not already installed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Node.js
brew install nodeUsing Official Installer
- Visit https://nodejs.org/
- Download the macOS installer (.pkg)
- Run the installer and follow the prompts
Verify Installation
bash
node -v
npm -v