🟢 Install Node.js

Session 3, Topic 2 | Required Engine for Claude Code

⏱️ 20 minutes

The Engine Behind Claude Code

Node.js is the runtime environment that makes Claude Code work. Think of it as the engine in a car - you need it to make everything run, but you don't need to understand how it works internally!

🎯 Learning Objectives

  • Understand what Node.js is and why it's needed
  • Download the correct version for your system
  • Install Node.js with proper settings
  • Verify installation using PowerShell
  • Troubleshoot common installation issues

🤔 What is Node.js?

Node.js is a JavaScript runtime - software that lets your computer run JavaScript programs outside of web browsers.

Why Do We Need It?

What Gets Installed?

📥 Download Node.js

Choose the LTS (Long Term Support) version for stability:

🌐 Visit nodejs.org

Click the big green "LTS" button on the homepage

📦 Installation Walkthrough

Download the Installer

  1. Go to nodejs.org
  2. Click the large green button labeled "LTS" (e.g., "20.11.0 LTS")
  3. The installer will download to your Downloads folder
  4. File will be named something like node-v20.11.0-x64.msi (Windows) or node-v20.11.0.pkg (Mac)

Run the Installer (Windows)

  1. Double-click the downloaded .msi file
  2. Click "Next" on the welcome screen
  3. Accept the license agreement → "Next"
  4. Important: Keep the default installation folder → "Next"
  5. Important: Select "Automatically install necessary tools" checkbox
  6. Keep all default features selected → "Next"
  7. Click "Install" (may ask for administrator permission - click "Yes")
  8. Wait 2-3 minutes for installation
  9. Click "Finish"

Run the Installer (Mac)

  1. Double-click the downloaded .pkg file
  2. Click "Continue" through the introduction
  3. Accept the license → "Continue" → "Agree"
  4. Keep standard installation location → "Install"
  5. Enter your Mac password when prompted
  6. Wait 2-3 minutes for installation
  7. Click "Close"

Important: Restart PowerShell/Terminal

⚠️ Critical Step: You MUST close and re-open PowerShell/Terminal after installing Node.js for it to work!
  1. Close all PowerShell or Terminal windows
  2. Open a fresh PowerShell/Terminal window
  3. Now you're ready to verify the installation

✅ Verify Installation

Open PowerShell (or Terminal on Mac) and run these commands:

Check Node.js Version

node --version

Expected output: v20.11.0 (or similar version number)

Check npm Version

npm --version

Expected output: 10.2.4 (or similar version number)

✅ Success! If you see version numbers for both commands, Node.js is installed correctly and ready to use!

🔧 Troubleshooting

Problem Solution
"command not found" or "not recognized" 1. Close PowerShell completely
2. Re-open PowerShell
3. Try commands again
If still not working, restart your computer
Permission denied error Run PowerShell as Administrator:
Right-click PowerShell → "Run as Administrator"
Old version showing 1. Uninstall old Node.js from Control Panel (Windows) or Applications (Mac)
2. Restart computer
3. Install new version
Installation fails 1. Disable antivirus temporarily
2. Run installer as Administrator
3. Check you have 500MB free disk space

💡 Understanding npm (Bonus Knowledge)

npm (Node Package Manager) was automatically installed with Node.js. Here's what it does:

  • Installs Tools: Like an app store for developer tools
  • Manages Updates: Keeps your tools up to date
  • Global vs Local: Can install tools system-wide (-g flag) or per-project

You'll use npm to install Claude Code in the next topic!

🎯 Quick Test Commands

Try these commands to explore Node.js:

1. Interactive Node.js Shell

node

Opens a JavaScript interactive shell. Type .exit to quit.

2. Check npm Configuration

npm config list

Shows npm settings and installation directory.

3. List Globally Installed Packages

npm list -g --depth=0

Shows what tools are installed globally (should be mostly empty for now).

✅ Topic Completion Checklist

🚀 What's Next?

Now that Node.js is installed, you have everything you need to:

But first, we need to set up your Anthropic Console account and get an API key!

Next Topic: Anthropic Console Setup →