Skip to main content

Claude Code Installation Guide: native vs npm, Windows Included

Claude Code install methods (native/npm), prerequisites, Windows WSL2 setup, authentication, and a recommended first step (CLAUDE.md), step by step.

ByUpdated
🌐 This article was machine-translated and may contain inaccuracies. Read the Korean original if in doubt.

Claude Code is Anthropic's terminal-based AI coding agent. It can read your codebase, edit files, run commands, and work with git directly. This article covers installation and initial setup.

🟢 Model references match the current lineup · model notice · Fable subscription
🟢 Model references match the current lineup · Claude Opus 5.5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.

Fable 5 and 5.1 subscription (updated September 7, 2026): Claude Fable 5.1, released September 1, 2026, is the current Fable model and Fable 5 is now legacy. Plan terms are the same for both — Max and Team Premium plans include Fable at up to 50% of the weekly usage limit; Pro and Team Standard use usage credits (

🟢 Model references match the current lineup · Claude Opus 5.5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.
0/M input, $50/M output tokens). The one-time
🟢 Model references match the current lineup · Claude Opus 5.5 / Claude Sonnet 5 / Claude Haiku 4.5 (higher tier: Claude Fable 5.1). This notice changes only when Anthropic ships a new model.
00 credit applied only to the Fable 5 transition and is not offered for 5.1. Some coding and debugging requests may be answered by an Opus model due to a security classifier (both models). See the Fable 5.1 guide and the Fable 5 availability guide for details.

New to it? See What is Claude Code? first to learn how it differs from a chatbot or autocomplete.

Claude Code install flow 1 Check plan Pro·Max or API 2 Install (native) mac/Linux: install.sh Win: install.ps1 3 First run run claude -> browser login 4 Verify claude --version claude doctor Not on free plan. Native install recommended (npm deprecated). June 2026.

Before you install

  • A paid Claude subscription or API credits: you can't use Claude Code on the free Claude.ai plan. You need a Claude Pro ($20/month) or higher subscription, or an Anthropic Console account with credits.
  • (For npm install only) Node.js 22+ (since v2.1.198): the native install method doesn't require Node.js.
  • Git (optional, recommended): used for version-control integration.

This is Anthropic's currently recommended default. It needs no dependencies like Node.js and supports automatic background updates. Run the install script in a macOS/Linux/WSL terminal and the binary is installed on your PATH. Check the official docs (code.claude.com/docs) for the exact install command.

Method 2: npm install

Use this when npm is standard in your environment or you need to pin a specific version.

npm install -g @anthropic-ai/claude-code

As of v2.1.198 this package requires Node.js 22+. On an older version npm prints an EBADENGINE warning, but the install completes and claude still runs — the package downloads a native binary that doesn't use Node.js at runtime (official setup docs, September 2026).

Important: don't use sudo. If you get a permission error (EACCES), instead of sudo, point npm's global directory to a user folder (npm config set prefix '~/.npm-global') or use nvm. nvm installs Node.js in your home directory, eliminating permission problems at the source.

Windows users

On Windows, the WSL2 (Windows Subsystem for Linux) environment is recommended. It removes most compatibility issues and provides a proper Unix environment. Install Node.js inside the WSL terminal (not on the Windows side), and it's best to install nvm inside WSL.

Authentication

After install, running claude for the first time in a project directory connects to your Anthropic account via a browser-based OAuth flow. API-key authentication is also available for headless/server environments. In enterprise settings, deployment via Amazon Bedrock or Google Vertex AI is also supported.

Verify the install

claude --version

If a version number appears, the install succeeded.

Which install for your OS?macOS / Linuxnative install(recommended)Windowsnative (recently) orWSL2 (MCP-compat first)Any, fallbacknpm install(deprecated)Install methods/support may change by version — see official docs · as of 2026.6

Common install problems

Common symptoms → fixesclaude: command not foundnot found on PATHAdd npm global bin to PATHnpm config get prefix → its /binEACCES (permission)permission deniedNo sudo · set npm prefix to ~/.npm-globalor install Node in home via nvmWSL: node: not foundwhich node shows /mnt/c/Install Node inside the distroWindows Node bleeding inNot sure what’s wrong?ambiguous symptomRun claude doctorchecks install, auth, perms, NodeSee the list below for details · as of 2026.6
  • claude: command not found: the npm global bin directory isn't on your PATH. Run npm config get prefix and add its /bin subfolder to your shell PATH (after a native install, open a new terminal first).
  • Permission (EACCES) errors: don't use sudo — it creates the ownership tangle it appears to solve. Run npm config set prefix ~/.npm-global and add ~/.npm-global/bin to your PATH, or install Node in your home directory with nvm.
  • WSL shows node: not found: if which node prints a path starting with /mnt/c/, Windows’ Node is bleeding into Linux. Install Node inside the distro via nvm or its package manager.
  • Not sure what’s wrong? Run claude doctor first — it checks install path, auth, permissions, and Node version in one pass.

Node.js is not a system requirement in the official docs (September 2026); only the npm route asks for Node.js 22+. The native installer sidesteps Node, PATH, and permission issues entirely.

Creating a CLAUDE.md file in your project root helps Claude Code understand the project context better. Writing down coding conventions, directory structure, and build/test commands makes a big difference in practice.


Learn more: control allow and deny rules and permission modes with Claude Code permissions.

Install commands and detailed options may change by version. Check Anthropic's official docs (code.claude.com/docs) for the latest.

See also: Claude Code IDE Setup (VS Code & JetBrains)

Related: Claude Code Pricing Explained: Plans, API Costs & Limits

Was this helpful?

Keep reading