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.
- YouCheck Node.js
Version 22 or newer
- YouInstall the CLI
One npm command
- YouVerify
Version and doctor
- YouSign in
First run opens a browser
- NextInstall the toolkit
Deployment & Usage
What you need first
Check four items before you install.
| Item | Requirement |
|---|---|
| Node.js | Version 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. |
| PowerShell | The toolkit installer install.ps1 runs in it. Native Windows needs no WSL and no Git Bash. |
| Python 3.10 or newer | install.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. |
| Git | Needed to clone the toolkit in the next step. The GitHub CLI gh is needed only for the optional Knowledge Vault clone. See Knowledge Vault. |
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
Check Node.js
The output must start with
Youv22or a higher number.node --version - 2
Install Node.js, if it is older or missing
Run the command, then open a new terminal.
Youwinget install OpenJS.NodeJS.LTS - 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
Install Claude Code
Run this command. If npm prints a warning or an error, see Gotcha 1 and Gotcha 2.
Younpm install -g @anthropic-ai/claude-code - 5
Check the version
The output looks like
You2.1.218 (Claude Code), with your version number.claude --version2.1.218 (Claude Code)IllustrationOutput as recorded for Claude Code 2.1.218. It was not run again. Your version number differs. - 6
Run the doctor
It reports the installed version, the component availability and the environment problems.
Youclaude 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.
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.
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
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
$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.
Recommended: allow local scripts for the current user only
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
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).
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 withENOMATCH.
To run the postinstall anyway
Reinstall with scripts in the foreground.
npm install -g @anthropic-ai/claude-code --foreground-scripts
Next step
Go to Deployment & Usage. Clone the toolkit (step 2), then run the preview.
$env:DRY_RUN=1; .\deploy\scripts\install.ps1