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.

🌐 This article was machine-translated and may contain inaccuracies. Refer to 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.

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) Node.js 18+: the native install method doesn't require Node.js.
  • Git (optional, recommended): used for version-control integration.

Method 1: native install (recommended)

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

This method requires Node.js 18+. On versions below 18 it installs but errors at runtime.

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.

Recommended first step after install

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.


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