Articles in this section
Category / Section

Installing Node.js for Claude Desktop MCP Usage

3 mins read
Updated:

Introduction

Node.js is a JavaScript runtime environment that’s required to run Model Context Protocol (MCP) servers with Claude Desktop. MCP allows Claude Desktop to connect to external tools and data sources, greatly extending its capabilities. This guide will walk you through installing Node.js on both Mac and Windows systems.

What You’ll Need

  • A Mac or Windows computer
  • Administrator privileges on your system
  • Internet connection for downloading Node.js

Installation Instructions

For Mac Users

Method 1: Using the Official Installer (Recommended)

  1. Visit the Node.js website

    • Go to nodejs.org
    • Click on the LTS (Long Term Support) version download button
    • This will download a .pkg file for macOS
  2. Run the installer

    • Locate the downloaded .pkg file in your Downloads folder
    • Double-click the installer to launch it
    • Follow the installation wizard:
      • Click “Continue” through the introduction screens
      • Accept the license agreement
      • Choose the installation location (default is recommended)
      • Click “Install” and enter your admin password when prompted
  3. Verify the installation

    • Open Terminal (Press Cmd + Space, type “Terminal”, and press Enter)
    • Type the following commands to verify Node.js and npm are installed:
    node --version
    npm --version
    
    • You should see version numbers for both commands

Method 2: Using Homebrew (For Advanced Users)

If you have Homebrew installed:

  1. Open Terminal
  2. Install Node.js using Homebrew
    brew install node
    
  3. Verify the installation
    node --version
    npm --version
    

For Windows Users

Method 1: Using the Official Installer (Recommended)

  1. Visit the Node.js website

    • Go to nodejs.org
    • Click on the LTS (Long Term Support) version download button
    • This will download a .msi file for Windows
  2. Run the installer

    • Locate the downloaded .msi file in your Downloads folder
    • Double-click the installer to launch it
    • Follow the installation wizard:
      • Click “Next” through the welcome screen
      • Accept the license agreement
      • Choose the installation path (default is recommended: C:\Program Files\nodejs\)
      • Important: Make sure “Add to PATH” is checked (this is usually enabled by default)
      • Click “Install” and allow the installer to make changes when prompted
  3. Restart your computer (recommended to ensure PATH changes take effect)

  4. Verify the installation

    • Open Command Prompt or PowerShell:
      • Press Win + R, type cmd, and press Enter (for Command Prompt)
      • Or press Win + X and select “Windows PowerShell” (for PowerShell)
    • Type the following commands:
    node --version
    npm --version
    
    • You should see version numbers for both commands

Method 2: Using Chocolatey (For Advanced Users)

If you have Chocolatey package manager installed:

  1. Open PowerShell as Administrator
  2. Install Node.js using Chocolatey
    choco install nodejs
    
  3. Verify the installation
    node --version
    npm --version
    

Recommended Node.js Version

For Claude Desktop MCP usage, it’s recommended to use:

  • Node.js 18.x LTS or newer
  • The LTS (Long Term Support) version is more stable and recommended for most users

Verifying Your Installation

After installation, verify that everything is working correctly:

Check Node.js and npm versions

node --version
npm --version

Test Node.js functionality

Create a simple test file to ensure Node.js is working:

  1. Create a new file called test.js with the following content:

    console.log("Node.js is working correctly!");
    console.log("Node.js version:", process.version);
    
  2. Run the file:

    node test.js
    
  3. You should see the output confirming Node.js is working.

Troubleshooting Common Issues

Mac Troubleshooting

Issue: Command not found after installation

  • Solution: Restart Terminal or run source ~/.bash_profile or source ~/.zshrc
  • Alternative: Check if Node.js is in your PATH by running echo $PATH

Issue: Permission errors when installing packages globally

  • Solution: Use sudo prefix or configure npm to use a different directory for global packages

Windows Troubleshooting

Issue: ‘node’ is not recognized as an internal or external command

  • Solution:
    1. Restart Command Prompt or PowerShell
    2. Restart your computer
    3. Check if Node.js is in your PATH:
      • Open System Properties → Advanced → Environment Variables
      • Look for C:\Program Files\nodejs\ in the PATH variable

Issue: Permission errors

  • Solution: Run Command Prompt or PowerShell as Administrator

General Troubleshooting

Issue: Installation fails or Node.js doesn’t work

  • Solution:
    1. Uninstall Node.js completely
    2. Download the latest LTS version from the official website
    3. Run the installer as Administrator (Windows) or with sudo (Mac if needed)

Next Steps

Once Node.js is successfully installed, you can:

  1. Configure Claude Desktop MCP: Follow Claude Desktop’s documentation to set up MCP servers
  2. Install MCP packages: Use npm to install specific MCP server packages as needed
  3. Create custom MCP servers: Develop your own MCP servers using Node.js

Additional Resources

Summary

You now have Node.js installed and ready for use with Claude Desktop’s MCP functionality. The installation provides you with both Node.js (the runtime) and npm (the package manager), which are essential for running and managing MCP servers. If you encounter any issues, refer to the troubleshooting section above or consult the official Node.js documentation.

Was this article useful?
Like
Dislike
Help us improve this page
Please provide feedback or comments
Access denied
Access denied