Getting started with Claude Code

Troubleshooting WSL installation

Currently, Claude Code does not run directly in Windows, and instead requires WSL. If you encounter issues in WSL:

  1. OS/platform detection issues: If you receive an error during installation, WSL may be using Windows npm. Try:

    • Run npm config set os linux before installation
    • Install with npm install -g @anthropic-ai/claude-code --force --no-os-check (Do NOT use sudo)
  2. Node not found errors: If you see exec: node: not found when running claude, your WSL environment may be using a Windows installation of Node.js. You can confirm this with which npm and which node, which should point to Linux paths starting with /usr/ rather than /mnt/c/. To fix this, try installing Node via your Linux distribution’s package manager or via nvm.

Read more here: Source link