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?
- Claude Code Requirement: Claude Code is built with Node.js and won't work without it
- Package Manager (npm): Comes with npm, which installs and manages development tools
- Industry Standard: Used by millions of developers worldwide
- Free & Safe: 100% free, open-source, and trusted by major companies
What Gets Installed?
- Node.js: The JavaScript runtime
- npm: Node Package Manager (for installing tools)
- PATH updates: Makes commands work from PowerShell
📥 Download Node.js
Choose the LTS (Long Term Support) version for stability:
🌐 Visit nodejs.orgClick the big green "LTS" button on the homepage
📦 Installation Walkthrough
Download the Installer
- Go to nodejs.org
- Click the large green button labeled "LTS" (e.g., "20.11.0 LTS")
- The installer will download to your Downloads folder
- File will be named something like
node-v20.11.0-x64.msi(Windows) ornode-v20.11.0.pkg(Mac)
Run the Installer (Windows)
- Double-click the downloaded
.msifile - Click "Next" on the welcome screen
- Accept the license agreement → "Next"
- Important: Keep the default installation folder → "Next"
- Important: Select "Automatically install necessary tools" checkbox
- Keep all default features selected → "Next"
- Click "Install" (may ask for administrator permission - click "Yes")
- Wait 2-3 minutes for installation
- Click "Finish"
Run the Installer (Mac)
- Double-click the downloaded
.pkgfile - Click "Continue" through the introduction
- Accept the license → "Continue" → "Agree"
- Keep standard installation location → "Install"
- Enter your Mac password when prompted
- Wait 2-3 minutes for installation
- Click "Close"
Important: Restart PowerShell/Terminal
- Close all PowerShell or Terminal windows
- Open a fresh PowerShell/Terminal window
- Now you're ready to verify the installation
✅ Verify Installation
Open PowerShell (or Terminal on Mac) and run these commands:
Check Node.js Version
Expected output: v20.11.0 (or similar version number)
Check npm Version
Expected output: 10.2.4 (or similar version number)
🔧 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
Opens a JavaScript interactive shell. Type .exit to quit.
2. Check npm Configuration
Shows npm settings and installation directory.
3. List Globally Installed Packages
Shows what tools are installed globally (should be mostly empty for now).
✅ Topic Completion Checklist
- ✓ Understand what Node.js is and why it's needed
- ✓ Downloaded Node.js LTS version from nodejs.org
- ✓ Successfully installed with default settings
- ✓ Restarted PowerShell/Terminal
- ✓ Verified with
node --versioncommand - ✓ Verified with
npm --versioncommand - ✓ Both commands show version numbers
🚀 What's Next?
Now that Node.js is installed, you have everything you need to:
- Install Claude Code CLI
- Run AI-powered development tools
- Build custom projects with AI assistance
But first, we need to set up your Anthropic Console account and get an API key!