Install Claude Code (Windows)

Install the Claude Code command line interface (CLI) on Windows and fix the two common npm problems. Do this before Deployment & Usage: the toolkit installers need the claude command on your PATH. This page covers the CLI (@anthropic-ai/claude-code, the claude command) only. It does not cover the desktop app, the web app or IDE extensions.

  1. YouCheck Node.js

    Version 22 or newer

  2. YouInstall the CLI

    One npm command

  3. YouVerify

    Version and doctor

  4. YouSign in

    First run opens a browser

  5. NextInstall the toolkit

    Deployment & Usage

What you need first

Check four items before you install.

ItemRequirement
Node.jsVersion 22 or newer ("node": ">=22.0.0"). Older Node, such as 18.x, may start the CLI. npm then prints an EBADENGINE warning, and runtime problems can occur.
PowerShellThe toolkit installer install.ps1 runs in it. Native Windows needs no WSL and no Git Bash.
Python 3.10 or newerinstall.ps1 needs python3, python or the py launcher on the PATH for the dispatch economy step. It checks this first. If Python is missing or older, it prints winget install Python.Python.3.12 and stops. The Microsoft Store shortcut that opens the Store is not Python, and the installer treats it as missing.
GitNeeded to clone the toolkit in the next step. The GitHub CLI gh is needed only for the optional Knowledge Vault clone. See Knowledge Vault.
Versions come from Claude Code 2.1.218

The Node.js requirement, the npm messages and the version numbers on this page come from Claude Code package version 2.1.218. They were not run again on 2026-11-02. If your output differs, the Claude Code documentation wins.

Install the CLI

Run these steps in PowerShell, in this order.

  1. 1

    Check Node.js

    The output must start with v22 or a higher number.

    You
    PowerShell
    node --version
  2. 2

    Install Node.js, if it is older or missing

    Run the command, then open a new terminal.

    You
    PowerShell
    winget install OpenJS.NodeJS.LTS
  3. 3

    Fix the execution policy, if PowerShell blocks npm

    Do this before the next step. If npm says that running scripts is disabled, the command is in Gotcha 1.

    You
  4. 4

    Install Claude Code

    Run this command. If npm prints a warning or an error, see Gotcha 1 and Gotcha 2.

    You
    PowerShell
    npm install -g @anthropic-ai/claude-code
  5. 5

    Check the version

    The output looks like 2.1.218 (Claude Code), with your version number.

    You
    PowerShell
    claude --version 2.1.218 (Claude Code)
    IllustrationOutput as recorded for Claude Code 2.1.218. It was not run again. Your version number differs.
  6. 6

    Run the doctor

    It reports the installed version, the component availability and the environment problems.

    You
    PowerShell
    claude doctor

Upgrade Node.js after you install Claude Code

If you upgrade Node.js after you install Claude Code, run npm install -g @anthropic-ai/claude-code again. The CLI then binds to the new runtime.

You can also download the Node.js installer from https://nodejs.org and install it over the old version.

First run

Open a terminal in your project folder and start Claude.

PowerShell
cd path\to\your\project claude

On the first start, Claude opens a browser so that you can sign in to your Anthropic account. After the sign-in, the interactive session starts.

WSL alternative

You can install Claude Code inside a Windows Subsystem for Linux (WSL) distribution.

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

Run the same command in the WSL shell. The PowerShell execution-policy problem does not occur there. A WSL install is a separate Linux environment with its own ~/.claude.

Where to install the toolkit

Toolkit in WSL

WSL
DRY_RUN=1 deploy/scripts/install.sh

Run deploy/scripts/install.sh inside WSL. The command shown is the preview: it writes nothing.

Toolkit in your Windows profile

PowerShell
$env:DRY_RUN=1; .\deploy\scripts\install.ps1

Use install.ps1 from PowerShell. The command shown is the preview: it writes nothing.

Gotcha 1: PowerShell execution policy blocks npm

npm ships as a .ps1 script. If script execution is disabled, PowerShell refuses to run npm.

PowerShell
npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. + FullyQualifiedErrorId : UnauthorizedAccess
IllustrationOutput as recorded for Claude Code 2.1.218. It was not run again.

Recommended: allow local scripts for the current user only

PowerShell
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned

Answer Y at the prompt. With RemoteSigned, local scripts run and downloaded scripts must be signed.

Alternative: no policy change

PowerShell
npm.cmd install -g @anthropic-ai/claude-code

Call the .cmd shim. It skips the .ps1 execution-policy check.

Gotcha 2: npm blocks the postinstall script

If npm gates install scripts, the package installs but npm skips its postinstall step (node install.cjs).

PowerShell
npm warn allow-scripts 1 package has install scripts not yet covered by allowScripts: npm warn allow-scripts @anthropic-ai/claude-code@2.1.218 (postinstall: node install.cjs) npm warn allow-scripts Run `npm approve-scripts --allow-scripts-pending` to review, npm warn allow-scripts or `npm approve-scripts <pkg>` to allow.
IllustrationOutput as recorded for Claude Code 2.1.218. It was not run again.

WarningThe postinstall step is skipped

  • The skipped step only fine-tunes native components. The CLI runs without it, so you usually need no action.
  • npm approve-scripts <pkg> works on the current project directory, not on global packages. Against a global install it fails with ENOMATCH.
PowerShell
npm error code ENOMATCH npm error No installed packages match: @anthropic-ai/claude-code
IllustrationOutput as recorded for Claude Code 2.1.218. It was not run again.

To run the postinstall anyway

Reinstall with scripts in the foreground.

PowerShell
npm install -g @anthropic-ai/claude-code --foreground-scripts

Next step

Go to Deployment & Usage. Clone the toolkit (step 2), then run the preview.

PowerShell
$env:DRY_RUN=1; .\deploy\scripts\install.ps1
Open Deployment & Usage