Requirements
- Internet connection
Download
Always install the LTS (long-term support) version from nodejs.org.
Installation
Windows
- Run the
.msiinstaller and accept the defaults. - Leave Automatically install the necessary tools unticked unless your instructor says otherwise.
macOS
Use the .pkg installer, or Homebrew:
brew install node@22
Linux
Use a version manager so you never need sudo for npm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install --lts
Configuration
No configuration is needed. Check the versions in a new terminal.
Verification
Run each command in a new terminal window.
node -v→ expect v20.x or newer
npm -v→ expect Any version number
Common errors
node works in one terminal but not another
Fix
Close all terminals and your editor, then reopen. PATH is only read when a terminal starts.
