modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -261,15 +261,19 @@ * `~/.cache/claude/`: staged downloads * [`~/.claude.json`](</docs/en/claude-directory>): your global config file, where the installer records the install method -If you set `XDG_DATA_HOME`, `XDG_STATE_HOME`, or `XDG_CACHE_HOME`, the install uses those in place of `~/.local/share`, `~/.local/state`, and `~/.cache`. If you set [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>), the global config file lives under that directory instead of your home directory. Check whether the directories are writable: - - test -w ~/.local/bin && echo "writable" || echo "not writable" - test -w ~/.claude && echo "writable" || echo "not writable" - -If either directory isn’t writable, create the install directory and set your user as the owner: - - sudo mkdir -p ~/.local/bin - sudo chown -R $(whoami) ~/.local +If you set `XDG_DATA_HOME`, `XDG_STATE_HOME`, or `XDG_CACHE_HOME`, the install uses those in place of `~/.local/share`, `~/.local/state`, and `~/.cache`. If you set [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>), the global config file lives under that directory instead of your home directory. In Bash or Zsh, create missing directories and check whether each one is writable: + + for dir in ~/.claude/downloads ~/.local/bin ~/.local/share/claude ~/.local/state/claude ~/.cache/claude; do + mkdir -p "$dir" && test -w "$dir" && echo "writable: $dir" || echo "not writable: $dir" + done + +If a directory isn’t writable, or the install error names a path inside one, take ownership of all these directories. The first `chown` is for `~/.local/bin` and the parent directories, and the second is for the install directories and their contents: + + sudo mkdir -p ~/.claude/downloads ~/.local/bin ~/.local/share/claude ~/.local/state/claude ~/.cache/claude + sudo chown -h $(whoami) ~/.claude ~/.local ~/.local/bin ~/.local/share ~/.local/state ~/.cache + sudo chown -R $(whoami) ~/.claude/downloads ~/.local/share/claude ~/.local/state/claude ~/.cache/claude + +Then run the [install command](</docs/en/setup#install-claude-code>) again. ### Verify the binary works
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -50,6 +50,7 @@ `unable to get local issuer certificate`| Configure corporate CA certificates `OAuth error`, `That doesn't look like the full code`, or `403 Forbidden`| Fix authentication `Claude Code access has not been granted for this account`| Get a role that includes Claude Code +`That code wasn't accepted`| Sign in again and paste the new code `Unable to connect to Anthropic services` during setup| See [Unable to connect to Anthropic services](</docs/en/errors#unable-to-connect-to-anthropic-services>) in the Error reference `Could not load the default credentials` or `Could not load credentials from any providers`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials `ChainedTokenCredential authentication failed` or `CredentialUnavailableError`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials @@ -893,7 +894,11 @@ Check Keychain access -Run `claude doctor` to check Keychain access. When the Keychain rejects writes, the report lists a warning that starts with `macOS Keychain is not writable`, followed by a suggested fix. When the report lists no Keychain warning, the Keychain is writable and you can skip to the last step. +In the shell you run Claude Code from, run `claude doctor` and look for a warning that starts with `macOS Keychain is not writable`. What the report shows decides your next step: + + * **No such warning** : skip to the last step + * **A warning whose fix says`Unlocking the Keychain won't help`**: follow that fix. If that shell is sandboxed, restart these steps outside the sandbox to move your login back + * **A warning with another fix** : go on to the next step 2
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -57,7 +57,7 @@ If your issue isn’t listed, work through the diagnostic checks below to narrow down the cause. -If you’d rather skip the terminal entirely, the [Claude Code Desktop app](</docs/en/desktop-quickstart>) lets you install and use Claude Code through a graphical interface. Download it for [macOS](<https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs>) or [Windows](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>) and start coding without any command-line setup. On Linux, install the app with apt by following the [Linux install instructions](</docs/en/desktop-linux>). +If you’d rather skip the terminal entirely, the [Claude Code Desktop app](</docs/en/desktop-quickstart>) lets you install and use Claude Code through a graphical interface. Download it for [macOS](<https://claude.ai/claude-code/desktop-download?platform=mac&utm_source=claude_code&utm_medium=docs>) or [Windows](<https://claude.ai/claude-code/desktop-download?platform=win&utm_source=claude_code&utm_medium=docs>) and start coding without any command-line setup. On Linux, install the app with apt by following the [Linux install instructions](</docs/en/desktop-linux>). ## Run diagnostic checks
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -208,7 +208,7 @@ ls -la ~/.local/bin/claude -A native install shows a symlink into `~/.local/share/claude/versions/`. A script or a symlink you created yourself at this path is a custom launcher, which [auto-update leaves in place](</docs/en/setup#auto-updates>).If either `ls` command prints `No such file or directory`, that’s not an error. It means nothing is installed at that location, so move on to the next check. +A native install shows a symlink into `~/.local/share/claude/versions/`. If you put your own launcher at this path, see [Custom launchers](</docs/en/setup#custom-launchers>).If either `ls` command prints `No such file or directory`, that’s not an error. It means nothing is installed at that location, so move on to the next check. ls -la ~/.claude/local/
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -588,7 +588,7 @@ ### Install hangs in Docker -When installing Claude Code in a Docker container, installing as root into `/` can cause hangs. **Solutions:** +**Solutions:** 1. **Set a working directory** before running the installer:
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -48,7 +48,7 @@ On Windows, the install command prints script text and nothing installs| Run the complete install command `App unavailable in region`| Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). `unable to get local issuer certificate`| Configure corporate CA certificates -`OAuth error` or `403 Forbidden`| Fix authentication +`OAuth error`, `That doesn't look like the full code`, or `403 Forbidden`| Fix authentication `Claude Code access has not been granted for this account`| Get a role that includes Claude Code `Unable to connect to Anthropic services` during setup| See [Unable to connect to Anthropic services](</docs/en/errors#unable-to-connect-to-anthropic-services>) in the Error reference `Could not load the default credentials` or `Could not load credentials from any providers`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials @@ -590,7 +590,7 @@ When installing Claude Code in a Docker container, installing as root into `/` can cause hangs. **Solutions:** - 1. **Set a working directory** before running the installer. When run from `/`, the installer scans the entire filesystem, which causes excessive memory usage. Setting `WORKDIR` limits the scan to a small directory: + 1. **Set a working directory** before running the installer: WORKDIR /tmp RUN curl -fsSL https://claude.ai/install.sh | bash @@ -815,9 +815,9 @@ If the browser doesn’t open automatically during login, press `c` to copy the OAuth URL to your clipboard, then paste it into a browser manually. This also works when the URL wraps across lines in a narrow or SSH terminal and can’t be clicked directly. -### OAuth error: Invalid code - -If you see `OAuth error: Invalid code. Please make sure the full code was copied`, the login code expired or was truncated during copy-paste. **Solutions:** +### That doesn’t look like the full code + +If you see `That doesn't look like the full code`, copy the whole login code from the browser, including the `#` in the middle, and paste it again. If you see `OAuth error: Invalid code. Please make sure the full code was copied`, the login code expired or was truncated during copy-paste. **Solutions:** * Press Enter to retry and complete the login quickly after the browser opens * Type `c` to copy the full URL if the browser doesn’t open automatically
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -455,7 +455,7 @@ The connection dropped while downloading the update (attempt 3/3: aborted). Check your network — proxies sometimes cut off large downloads. -The text in parentheses names which attempt failed and the underlying network error. `claude update` precedes the message with `Error: Failed to install native update` on stderr. A download that stays connected but doesn’t finish within 10 minutes fails with `Download timed out: exceeded the total deadline` instead. Claude Code doesn’t retry a timed-out download, because a connection too slow to finish inside the deadline won’t finish on an immediate retry either. The steps below apply to both messages. A proxy or gateway can close a long transfer before it finishes, and the Claude Code binary is a large download. **What to do:** +The text in parentheses names which attempt failed and the underlying network error. `claude update` precedes the message with `Failed to install native update`. A download that stays connected but doesn’t finish within 10 minutes fails with `Download timed out: exceeded the total deadline` instead. Claude Code doesn’t retry a timed-out download, because a connection too slow to finish inside the deadline won’t finish on an immediate retry either. The steps below apply to both messages. A proxy or gateway can close a long transfer before it finishes, and the Claude Code binary is a large download. **What to do:** * Run `claude update` again. On an otherwise healthy network, the download usually succeeds on the next run. For the timed-out message, run it again from a faster or less throttled network. * If your network requires a proxy, set `HTTPS_PROXY` before running the installer or `claude update`. See Check network connectivity. @@ -470,7 +470,7 @@ Take the step that matches the value in parentheses in your message: - * **A value that starts with`sidecar_fetch_`**: run the same command again from your shell. `claude update` succeeded if it prints a line that starts with `Successfully updated from`, and `claude install` succeeded if it prints `Claude Code successfully installed!`. + * **A value that starts with`sidecar_fetch_`**: run the same command again from your shell. `claude update` succeeded if it prints a line that ends with `to version <new version>`, and `claude install` succeeded if it prints `Claude Code successfully installed!`. * **Any other value** : try the same command again later With any value, if the message repeats, report the problem and include the full message.
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -706,7 +706,7 @@ ### npm install errors in WSL -These issues apply if you installed Claude Code with `npm install -g` inside WSL. If you used the [native installer](</docs/en/setup>), skip this section. On npm 12, install as Fix an npm 12 install describes. **OS or platform detection issues.** If npm reports a platform mismatch during install, WSL is likely picking up the Windows `npm`. Run `npm config set os linux` first, then install with `npm install -g @anthropic-ai/claude-code --force`. Do not use `sudo`. **`exec: node: not found` when running `claude`.** Your WSL environment is likely using the Windows installation of Node.js. Confirm with `which npm` and `which node`: paths starting with `/mnt/c/` are Windows binaries, while Linux paths start with `/usr/`. To fix this, install Node via your Linux distribution’s package manager or via [`nvm`](<https://github.com/nvm-sh/nvm>). **nvm version conflicts.** If you have nvm installed in both WSL and Windows, switching Node versions in WSL may break because WSL imports the Windows PATH by default and the Windows nvm takes priority. The most common cause is that nvm isn’t loaded in your shell. Add the nvm loader to `~/.bashrc` or `~/.zshrc`: +These issues apply if you installed Claude Code with `npm install -g` inside WSL. If you used the [native installer](</docs/en/setup>), skip this section. On npm 12, install as Fix an npm 12 install describes. **OS or platform detection issues.** If npm reports a platform mismatch during install, run `npm config set os linux` first, then install with `npm install -g @anthropic-ai/claude-code@latest --force`. Do not use `sudo`. **`exec: node: not found` when running `claude`.** Your WSL environment is likely using the Windows installation of Node.js. Confirm with `which npm` and `which node`: paths starting with `/mnt/c/` are Windows binaries, while Linux paths start with `/usr/`. To fix this, install Node via your Linux distribution’s package manager or via [`nvm`](<https://github.com/nvm-sh/nvm>). **nvm version conflicts.** If you have nvm installed in both WSL and Windows, switching Node versions in WSL may break because WSL imports the Windows PATH by default and the Windows nvm takes priority. The most common cause is that nvm isn’t loaded in your shell. Add the nvm loader to `~/.bashrc` or `~/.zshrc`: export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" @@ -764,7 +764,7 @@ 3. Reinstall: - npm install -g @anthropic-ai/claude-code + npm install -g @anthropic-ai/claude-code@latest If this or step 1 fails with `EACCES`, switch to the native installer instead of rerunning it with `sudo`. Claude Code runs npm without `sudo` when it updates itself, so automatic updates would fail the same way. 4. If `claude --version` doesn’t print a version number, check the other causes. @@ -772,7 +772,7 @@ ### npm `ENOTEMPTY` error during update or reinstall -When you run `npm install -g @anthropic-ai/claude-code` over an existing installation, npm can fail while moving the old package directory aside: +When you run `npm install -g @anthropic-ai/claude-code@latest` over an existing installation, npm can fail while moving the old package directory aside: npm error code ENOTEMPTY npm error syscall rename @@ -797,7 +797,7 @@ Then reinstall. On npm 12, follow Fix an npm 12 install. Otherwise, run: - npm install -g @anthropic-ai/claude-code + npm install -g @anthropic-ai/claude-code@latest Confirm with `claude --version`, which prints a version number such as `2.1.211 (Claude Code)`.
modified
Show diff (665 lines)
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -1,10 +1,6 @@ If installation fails or you can’t sign in, find your error below. For runtime issues after Claude Code is working, see [Troubleshooting](</docs/en/troubleshooting>). For configuration problems such as settings not applying or hooks not firing, see [Debug your configuration](</docs/en/debug-your-config>). -## - -​ - -Find your error +## Find your error Match the error message or symptom you’re seeing to a fix: @@ -63,17 +59,9 @@ If you’d rather skip the terminal entirely, the [Claude Code Desktop app](</docs/en/desktop-quickstart>) lets you install and use Claude Code through a graphical interface. Download it for [macOS](<https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs>) or [Windows](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>) and start coding without any command-line setup. On Linux, install the app with apt by following the [Linux install instructions](</docs/en/desktop-linux>). -## - -​ - -Run diagnostic checks - -### - -​ - -Check network connectivity +## Run diagnostic checks + +### Check network connectivity The installer downloads from `downloads.claude.ai`. Verify you can reach it: @@ -112,11 +100,7 @@ $env:HTTPS_PROXY = 'http://proxy.example.com:8080' irm https://claude.ai/install.ps1 | iex -### - -​ - -Verify your PATH +### Verify your PATH If installation succeeded but you get a `command not found` or `not recognized` error when running `claude`, the install directory isn’t in your PATH. Your shell searches for programs in directories listed in PATH, and the installer places `claude` at `~/.local/bin/claude` on macOS/Linux or `%USERPROFILE%\.local\bin\claude.exe` on Windows. The installer detects this case and reports it under `Setup notes:` in its output: `Native installation exists but ~/.local/bin is not in your PATH.` on macOS and Linux, or `Native installation exists but C:\Users\you\.local\bin is not in your PATH.` on Windows. It prints the fix with that note but doesn’t change PATH itself. @@ -208,11 +192,7 @@ If `claude` is still not found in a new terminal, a terminal inside an editor takes its PATH from the editor, so quit and reopen the editor too. -### - -​ - -Check for conflicting installations +### Check for conflicting installations Multiple Claude Code installations can cause version mismatches or unexpected behavior. Check what’s installed: @@ -269,11 +249,7 @@ winget uninstall Anthropic.ClaudeCode -### - -​ - -Check directory permissions +### Check directory permissions An install that fails on permissions names the path it couldn’t create or write. On Windows the install writes under `%USERPROFILE%`, which is writable by your user by default, so this section rarely applies there. On macOS and Linux the install writes to these locations: @@ -294,11 +270,7 @@ sudo mkdir -p ~/.local/bin sudo chown -R $(whoami) ~/.local -### - -​ - -Verify the binary works +### Verify the binary works If `claude --version` prints a version but `claude` crashes or hangs on startup, run these checks to narrow down the cause. If `claude --version` says command not found, go to Verify your PATH first; the commands below assume `claude` is on your PATH. Confirm the binary exists and is executable: @@ -310,7 +282,7 @@ Get-Command claude | Select-Object Source -On Linux, check for missing shared libraries. If `ldd` shows missing libraries, you may need to install system packages. On Alpine Linux and other musl-based distributions, see [Alpine Linux setup](</docs/en/setup#alpine-linux-and-musl-based-distributions>). +On Linux, check for missing shared libraries. If `ldd` shows missing libraries, you may need to install system packages. On Alpine Linux and other musl-based distributions, see Linux musl or glibc binary mismatch. ldd "$(command -v claude)" | grep "not found" @@ -318,19 +290,11 @@ claude --version -## - -​ - -Common installation issues +## Common installation issues These are the most frequently encountered installation problems and their solutions. -### - -​ - -Install script returns HTML instead of a shell script +### Install script returns HTML instead of a shell script The install command fails with one of these errors when what it downloaded isn’t the install script. **Bash or Zsh** : the error quotes the first line of the returned page. @@ -372,11 +336,7 @@ Then run `claude --version` to confirm: the command prints a version number such as `2.1.211 (Claude Code)`. If the shell reports `claude` isn’t found, open a new terminal window and retry: the session you installed from keeps its old `PATH`. -### - -​ - -`command not found: claude` after installation +### `command not found: claude` after installation The install finished but `claude` doesn’t work. The exact error varies by platform: @@ -389,11 +349,7 @@ On Windows, if the error started right after Claude Code updated, see restore `claude.exe` from its backup. Otherwise, see Verify your PATH for the fix on each platform. -### - -​ - -`permission denied` when adding to your PATH +### `permission denied` when adding to your PATH If the `echo` command that adds `~/.local/bin` to your PATH prints `zsh: permission denied: /Users/you/.zshrc` or `bash: /home/you/.bashrc: Permission denied`, your user can’t write to that file and nothing was saved. In your terminal, check who owns the file, using your shell’s file name in place of `~/.zshrc`: @@ -406,19 +362,11 @@ Then run the two PATH commands for your shell in Verify your PATH again. -### - -​ - -`curl: (56) Failure writing output to destination` +### `curl: (56) Failure writing output to destination` The `curl ... | bash` command downloads the script and pipes it to Bash for execution. This error, and the related `curl: (23) Failure writing output to destination`, means Bash did not receive the complete script. Exit code 56 indicates the download itself was interrupted, and exit code 23 indicates curl could not write what it received to the pipe, usually because Bash exited early. Test that you can reach `downloads.claude.ai` with the check in Check network connectivity. If you reached the server, the original failure was likely intermittent; retry the install command. You can also [try an alternative install method](</docs/en/setup#install-claude-code>). -### - -​ - -Homebrew cask unavailable or outdated +### Homebrew cask unavailable or outdated Homebrew reports `Error: Cask 'claude-code' is unavailable: No Cask with this name exists` when your local copy of the Homebrew cask index predates the cask’s publication. Refresh the index and retry: @@ -427,11 +375,7 @@ If Homebrew installs an older Claude Code version than you expect, the same stale index is usually the cause. The `claude-code` cask tracks the stable channel and is typically about one week behind the latest release; for the newest version run `brew install --cask claude-code@latest` instead. See [Configure release channel](</docs/en/setup#configure-release-channel>) for the difference between the two casks. -### - -​ - -`Cask 'claude-code@latest' is not installed` +### `Cask 'claude-code@latest' is not installed` Homebrew offers two casks, `claude-code` and `claude-code@latest`. Running `brew upgrade --cask claude-code@latest` when that cask isn’t the one installed prints `Error: Cask 'claude-code@latest' is not installed.` To see which cask you have, run this in your terminal: @@ -439,11 +383,7 @@ Upgrade the cask it prints. If it prints nothing, neither cask is installed. -### - -​ - -TLS or SSL connection errors +### TLS or SSL connection errors Errors such as these mean the TLS handshake failed: @@ -505,19 +445,11 @@ You can also install with `winget install Anthropic.ClaudeCode`, which avoids curl entirely. -### - -​ - -`Failed to fetch version from downloads.claude.ai` +### `Failed to fetch version from downloads.claude.ai` The end of the message gives the reason. If it’s a certificate error such as `unable to verify the first certificate`, see TLS or SSL connection errors. For any other reason, see Check network connectivity. -### - -​ - -The connection dropped while downloading the update +### The connection dropped while downloading the update The connection to the download server closed while `claude install` or `claude update` was fetching the Claude Code binary, and the retries didn’t recover. Claude Code retries the download when the connection drops, the transfer stalls, or the downloaded file fails its checksum, up to three attempts in total. A completed HTTP error, such as a 404, isn’t retried because the server already answered. Before v2.1.202, a single dropped connection failed the download immediately with the bare error `aborted` instead of retrying. @@ -530,11 +462,7 @@ * If a corporate proxy keeps closing the transfer, ask your network team to allow the full download from `downloads.claude.ai`. See [Network access requirements](</docs/en/network-config#network-access-requirements>). * Run `claude doctor` from your shell for installation diagnostics -### - -​ - -Release verification failed for Claude Code +### Release verification failed for Claude Code This message from `claude update` or `claude install` means Claude Code couldn’t confirm that the release it was about to install is genuine, so it installed nothing. Any version you already have keeps working. @@ -547,19 +475,11 @@ With any value, if the message repeats, report the problem and include the full message. -### - -​ - -`Auto-update failed · Run claude doctor` in the session footer +### `Auto-update failed · Run claude doctor` in the session footer This red line means Claude Code tried to update itself in the background and the update didn’t install. You can keep working without doing anything. The line points you to `claude doctor`, whose `Last update attempt: failed (install_failed)` line gives a date but no cause. To finish the update or see why it failed, run `claude update` in your shell instead. If that install fails too, look for the error `claude update` prints under Find your error. -### - -​ - -Wrong install command on Windows +### Wrong install command on Windows If you see `'irm' is not recognized`, `The token '&&' is not a valid statement separator`, `A parameter cannot be found that matches parameter name 'fsSL'`, or `'bash' is not recognized as the name of a cmdlet`, you copied the install command for a different shell or operating system. If the command prints the script’s text instead of installing anything, you ran only part of it. @@ -593,11 +513,7 @@ Whichever installer you use, confirm it worked: open a new terminal and run `claude --version`, which prints a version number such as `2.1.211 (Claude Code)`. -### - -​ - -`running scripts is disabled on this system` +### `running scripts is disabled on this system` Installing or running Claude Code through npm on Windows can fail with a `SecurityError`: @@ -614,22 +530,14 @@ 2. **Call the`.cmd` launcher instead**: `npm.cmd` and `claude.cmd` do the same job, and the policy doesn’t cover them. 3. **Use the[PowerShell installer](</docs/en/setup#install-claude-code>)** instead of npm. It installs a binary rather than a `.ps1` script. -### - -​ - -`The process cannot access the file` during Windows install +### `The process cannot access the file` during Windows install If the PowerShell installer fails with `Failed to download binary: The process cannot access the file ... because it is being used by another process`, the installer couldn’t write to `%USERPROFILE%\.claude\downloads`. This usually means a previous install attempt is still running, or antivirus software is scanning a partially downloaded binary in that folder. Close any other PowerShell windows running the installer and wait for antivirus scans to release the file. Then delete the downloads folder and run the installer again: Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\downloads" irm https://claude.ai/install.ps1 | iex -### - -​ - -`claude.exe` missing after an update on Windows +### `claude.exe` missing after an update on Windows If your terminal reports `'claude' is not recognized` right after Claude Code updated on Windows, check whether `%USERPROFILE%\.local\bin` still contains `claude.exe`. If that directory isn’t on your PATH at all, see Verify your PATH instead. To update on Windows, Claude Code renames the existing `claude.exe` aside to a backup and moves the new version into its place. If moving the new version into place fails and Claude Code can’t rename the backup back either, the directory keeps the backup but has no `claude.exe`. The backup is a file in the same directory whose name begins with `claude.exe.old.` followed by a numeric timestamp. Run the following in PowerShell to rename the newest backup back to `claude.exe`: @@ -641,11 +549,7 @@ Before v2.1.281, Claude Code could delete the backup while `claude.exe` was still missing. -### - -​ - -Install killed on low-memory Linux servers +### Install killed on low-memory Linux servers A `Killed` message during install usually means the Linux out-of-memory (OOM) killer terminated the `claude install` step because the system ran out of free memory. This is common on small VPS and cloud instances. The install script reports the cause and exits with code 137. In this example, the line number and process ID vary by release and run: @@ -670,11 +574,7 @@ 2. **Close other processes** to free memory before installing. 3. **Use a larger instance** if possible. Claude Code requires at least 4 GB of RAM. -### - -​ - -Installation was killed before it could finish +### Installation was killed before it could finish The install script reports when the `claude install` step is terminated by a signal. On Linux, exit code 137 means the process received SIGKILL, and on a low-memory host that’s usually the kernel out-of-memory (OOM) killer. The script prints this explanation and exits with code 137: @@ -686,11 +586,7 @@ * Stop other processes to free memory, then rerun the installer * Add swap space or move to a larger instance. See Install killed on low-memory Linux servers for the swap-file commands. -### - -​ - -Install hangs in Docker +### Install hangs in Docker When installing Claude Code in a Docker container, installing as root into `/` can cause hangs. **Solutions:** @@ -701,11 +597,7 @@ 2. **Give Docker more memory** if using Docker Desktop. Build containers share the memory allocated to the Docker Desktop virtual machine, so open **Settings > Resources** in Docker Desktop, raise the memory limit, and rerun the build. -### - -​ - -`Raw mode is not supported` during install +### `Raw mode is not supported` during install When your organization’s [server-managed settings](</docs/en/server-managed-settings>) include changes that need [security approval](</docs/en/server-managed-settings#security-approval-dialogs>), Claude Code versions before 2.1.246 try to show the approval dialog during `claude install`. The dialog needs a terminal on stdin. When the installer runs `claude install` from a pipe, as `curl -fsSL https://claude.ai/install.sh | bash` does, stdin is the pipe rather than a terminal, so the install fails with an error containing `Raw mode is not supported`. Claude Code v2.1.246 and later don’t show the dialog during `claude install` or `claude update`. The command runs with the settings you last approved, and Claude Code shows the dialog in your next interactive session. If your organization’s startup configuration [waits for the settings fetch](</docs/en/server-managed-settings#enforce-fail-closed-startup>), such as when it sets `forceRemoteSettingsRefresh`, the dialog still appears during these commands, and an install run from a pipe still fails. In every other configuration, rerunning the installer gets past this error, because the script runs the latest release’s `install` command even when you ask it to install an older version. Rerun the command for your platform: @@ -719,11 +611,7 @@ `claude --version` prints the version the rerun installed. -### - -​ - -`claude update` or `claude doctor` hangs +### `claude update` or `claude doctor` hangs `claude update` and `claude doctor` scan your shell configuration files for an outdated `claude` alias: `~/.zshrc`, `~/.bashrc`, and `~/.config/fish/config.fish`, plus on macOS the first of `~/.bash_profile`, `~/.bash_login`, or `~/.profile` that exists. If you set `ZDOTDIR`, the Zsh file is `$ZDOTDIR/.zshrc` instead. When one of those paths is a directory, Claude Code skips it and both commands complete normally. Before v2.1.214, a directory at one of those paths made both commands hang and left the System diagnostics section of `/status` blank. `claude doctor` hung with no output; `claude update` hung right after printing `Checking for updates`. If you hit the hang on an earlier version, find the directory. In this command’s output, a line starting with `d` marks that path as a directory. A `No such file or directory` line means nothing exists at that path and isn’t the cause: @@ -731,19 +619,11 @@ Move the directory aside, or update to v2.1.214 or later. Since `claude update` hangs on the affected versions, update by rerunning the [install script](</docs/en/setup#install-claude-code>) instead. -### - -​ - -Claude Desktop overrides the `claude` command on Windows +### Claude Desktop overrides the `claude` command on Windows If you installed an older version of Claude Desktop, it may register a `Claude.exe` in the `WindowsApps` directory that takes PATH priority over Claude Code CLI. Running `claude` opens the Desktop app instead of the CLI. Update Claude Desktop to the latest version to fix this issue. -### - -​ - -Claude Code on Windows requires either Git for Windows (for bash) or PowerShell +### Claude Code on Windows requires either Git for Windows (for bash) or PowerShell Git for Windows is optional. Claude Code uses the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) when Git Bash is absent, so this error means neither shell was found. **If PowerShell is missing from your PATH** , its default location is `C:\Windows\System32\WindowsPowerShell\v1.0\`. Add that directory to your `PATH`, or install [PowerShell 7](<https://aka.ms/powershell>), which provides `pwsh`. **To install Git for Windows instead** , download it from [git-scm.com/downloads/win](<https://git-scm.com/downloads/win>). During setup, select “Add to PATH.” Restart your terminal after installing. Installing it enables the Bash tool, useful when working with Bash-based scripts and tooling. **If Git is already installed** but Claude Code can’t find it, compare its location against the places Claude Code checks. When `CLAUDE_CODE_GIT_BASH_PATH` isn’t set, Claude Code looks for `bash.exe` in this order: @@ -760,11 +640,7 @@ **If`CLAUDE_CODE_GIT_BASH_PATH` is set to the correct path and the file exists** but Claude Code still doesn’t use it, check the file’s name first. Claude Code accepts only a file named `bash.exe`, `sh.exe`, `bash`, or `sh`; with any other name, such as Git for Windows’ `git-bash.exe` launcher, it ignores the variable and auto-detects Git Bash as if it were unset, logging a warning visible with `--debug`. A path that doesn’t exist gets the same fallback and warning. Before v2.1.219, Claude Code used any existing file as the shell without checking its name, and exited at startup with `Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path` when the path didn’t exist. If the file’s name is right, endpoint security software such as AppLocker, Group Policy software restriction policies, or EDR agents may be interfering. Ask your IT team to allowlist `claude.exe` and the processes it spawns, including `cmd.exe` and `bash.exe`, in your endpoint protection policy. -### - -​ - -Claude Code does not support 32-bit Windows +### Claude Code does not support 32-bit Windows Windows includes two PowerShell entries in the Start menu: `Windows PowerShell` and `Windows PowerShell (x86)`. The x86 entry runs as a 32-bit process and triggers this error even on a 64-bit machine. To check which case you’re in, run this in the same window that produced the error: @@ -772,17 +648,13 @@ If this prints `True`, your operating system is fine. Close the window, open `Windows PowerShell` without the x86 suffix, and run the install command again. If this prints `False`, you are on a 32-bit edition of Windows. Claude Code requires a 64-bit operating system. See the [system requirements](</docs/en/setup#system-requirements>). -### - -​ - -Linux musl or glibc binary mismatch - -If you see errors about missing shared libraries like `libstdc++.so.6` or `libgcc_s.so.1` after installation, the installer may have downloaded the wrong binary variant for your system. - - Error loading shared library libstdc++.so.6: No such file or directory - -This can happen on glibc-based systems that have musl cross-compilation packages installed, causing the installer to misdetect the system as musl. **Solutions:** +### Linux musl or glibc binary mismatch + +If you see errors about missing shared libraries like `ld-linux-x86-64.so.2` or `ld-linux-aarch64.so.1` after installation, the installer may have downloaded the wrong binary variant for your system. + + Error loading shared library ld-linux-x86-64.so.2: No such file or directory + +**Solutions:** 1. **Check which libc your system uses** : @@ -790,25 +662,13 @@ Output mentioning `GNU libc` or `GLIBC` means glibc. Output mentioning `musl` means musl. 2. **If you’re on glibc but got the musl binary** , remove the installation and reinstall. You can also manually download the correct binary using the manifest at `https://downloads.claude.ai/claude-code-releases/{VERSION}/manifest.json`. File a [GitHub issue](<https://github.com/anthropics/claude-code/issues>) with the output of `ldd --version` and `ls /lib/libc.musl*`. - 3. **If you’re actually on musl** , such as Alpine Linux, install the required packages: - - apk add libgcc libstdc++ ripgrep - -On Alpine, `ripgrep` is in the community repository. If `apk` reports that the package is missing, see [Alpine Linux setup](</docs/en/setup#alpine-linux-and-musl-based-distributions>). - -### - -​ - -`Illegal instruction` + 3. **If you’re on musl but got the glibc binary** , [remove the installation](</docs/en/setup#uninstall-claude-code>). On Alpine Linux, first install the packages that [Alpine Linux setup](</docs/en/setup#alpine-linux-and-musl-based-distributions>) names. Then run the [install command](</docs/en/setup#install-claude-code>), which installs the musl binary. + +### `Illegal instruction` If running `claude` or the installer prints `Illegal instruction`, the native binary uses CPU instructions your processor doesn’t support. There are two distinct causes. **Architecture mismatch.** The installer downloaded the wrong binary, for example x86 on an ARM server. Check with `uname -m` on macOS or Linux, or `$env:PROCESSOR_ARCHITECTURE` in PowerShell. If the result doesn’t match the binary you received, [file a GitHub issue](<https://github.com/anthropics/claude-code/issues>) with the output. **Missing AVX instruction set.** If your architecture is correct but you still see `Illegal instruction`, your CPU likely lacks AVX or another instruction the binary requires. This affects roughly pre-2013 Intel and AMD processors, and virtual machines where the hypervisor does not pass AVX through to the guest. On a VPS or VM, run `grep -m1 -ow avx /proc/cpuinfo`; an empty result means AVX is not available to the guest. There is no native-binary workaround; track [issue #50384](<https://github.com/anthropics/claude-code/issues/50384>) for status, and include your CPU model from `grep -m1 "model name" /proc/cpuinfo` on Linux or `sysctl -n machdep.cpu.brand_string` on macOS when reporting. Alternative install methods download the same native binary and won’t resolve either cause. -### - -​ - -`dyld: cannot load` on macOS +### `dyld: cannot load` on macOS If you see `dyld: Symbol not found`, `dyld: cannot load`, or `Abort trap: 6` during installation, the binary is incompatible with your macOS version or hardware. A `Symbol not found` error that references `libicucore` means your macOS version is older than the binary supports: @@ -826,19 +686,11 @@ 1. **Check your macOS version** : Claude Code requires macOS 13.0 or later. Open the Apple menu and select About This Mac to check your version. 2. **Update macOS** if you’re on an older version. The binary uses load commands and system libraries that older macOS versions don’t support. Alternative install methods like Homebrew download the same binary and won’t resolve this error. -### - -​ - -`Bus error` while a session is running +### `Bus error` while a session is running If a running session exits and your shell prints `Bus error`, one cause is that Claude Code could no longer read its own executable file from disk. For example, the file was truncated, or deleted on network storage, while the session ran. Before the shell’s message, Claude Code’s runtime can print a crash report that includes `panic(main thread): Bus error at address` and `oh no: Bun has crashed. This indicates a bug in Bun, not your code.` When the executable became unreadable, the crash comes from the unreadable file, not from a bug in Bun. The report can also be missing, if the runtime couldn’t read the code that prints it either. Start a new session to continue. If Claude Code is installed on network storage, follow [Install on network storage](</docs/en/setup#install-on-network-storage>) so upgrades don’t remove a binary that running sessions still need. -### - -​ - -`Exec format error` on WSL1 +### `Exec format error` on WSL1 If running `claude` in WSL prints `cannot execute binary file: Exec format error`, you’re on WSL1 and hitting a known native-binary regression tracked in [issue #38788](<https://github.com/anthropics/claude-code/issues/38788>). The binary’s program headers changed in a way WSL1’s loader can’t handle. The cleanest fix is to convert your distribution to WSL2 from PowerShell: @@ -852,11 +704,7 @@ Then run `source ~/.bashrc` and retry `claude`. -### - -​ - -npm install errors in WSL +### npm install errors in WSL These issues apply if you installed Claude Code with `npm install -g` inside WSL. If you used the [native installer](</docs/en/setup>), skip this section. On npm 12, install as Fix an npm 12 install describes. **OS or platform detection issues.** If npm reports a platform mismatch during install, WSL is likely picking up the Windows `npm`. Run `npm config set os linux` first, then install with `npm install -g @anthropic-ai/claude-code --force`. Do not use `sudo`. **`exec: node: not found` when running `claude`.** Your WSL environment is likely using the Windows installation of Node.js. Confirm with `which npm` and `which node`: paths starting with `/mnt/c/` are Windows binaries, while Linux paths start with `/usr/`. To fix this, install Node via your Linux distribution’s package manager or via [`nvm`](<https://github.com/nvm-sh/nvm>). **nvm version conflicts.** If you have nvm installed in both WSL and Windows, switching Node versions in WSL may break because WSL imports the Windows PATH by default and the Windows nvm takes priority. The most common cause is that nvm isn’t loaded in your shell. Add the nvm loader to `~/.bashrc` or `~/.zshrc`: @@ -874,21 +722,13 @@ Avoid disabling Windows PATH importing via `appendWindowsPath = false` as this breaks the ability to call Windows executables from WSL. Similarly, avoid uninstalling Node.js from Windows if you use it for Windows development. -### - -​ - -Permission errors during installation +### Permission errors during installation If the native installer fails with permission errors, the target directory may not be writable. See Check directory permissions. If you previously installed with npm and are hitting npm-specific permission errors, switch to the native installer: curl -fsSL https://claude.ai/install.sh | bash -### - -​ - -Native binary not found after npm install +### Native binary not found after npm install The `@anthropic-ai/claude-code` npm package downloads the native binary as a per-platform optional dependency, such as `@anthropic-ai/claude-code-darwin-arm64`. `claude` is a placeholder script until the `@anthropic-ai/claude-code` package’s postinstall step runs and replaces the placeholder with that binary. If either the download or the postinstall step is skipped, the placeholder stays in place, and running `claude` on macOS and Linux prints: @@ -911,11 +751,7 @@ * **Unsupported platform.** Prebuilt binaries are published for `darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `linux-x64-musl`, `linux-arm64-musl`, `win32-x64`, and `win32-arm64`. Claude Code does not ship a binary for other platforms; see the [system requirements](</docs/en/setup#system-requirements>). On FreeBSD, the installer reports the platform as unsupported. Before v2.1.205, it treated FreeBSD as Linux and downloaded a binary that couldn’t run. * **Corporate npm mirror is missing the platform packages.** Ensure your registry mirrors all eight `@anthropic-ai/claude-code-*` platform packages in addition to the meta package. -#### - -​ - -Fix an npm 12 install +#### Fix an npm 12 install If `claude` prints `Error: claude native binary not installed.` after an npm install or update, or on Windows the shell can’t run it, run `npm --version`. A version starting with `12` means that, unless your npm config allows it, npm skipped Claude Code’s postinstall step, which puts the binary in place. For any other version, check the other causes. To fix an npm 12 install, switch to the native installer or allow the step: @@ -934,11 +770,7 @@ 4. If `claude --version` doesn’t print a version number, check the other causes. To undo, set the list again without `@anthropic-ai/claude-code`, or remove the whole list with `npm config delete allow-scripts --location=user`. On npm 12, the error then returns after your next update. -### - -​ - -npm `ENOTEMPTY` error during update or reinstall +### npm `ENOTEMPTY` error during update or reinstall When you run `npm install -g @anthropic-ai/claude-code` over an existing installation, npm can fail while moving the old package directory aside: @@ -969,19 +801,11 @@ Confirm with `claude --version`, which prints a version number such as `2.1.211 (Claude Code)`. -## - -​ - -Login and authentication +## Login and authentication These sections address login failures, OAuth errors, and token issues. -### - -​ - -Reset your login +### Reset your login When login fails and the cause isn’t clear, a clean re-authentication resolves most cases: @@ -991,11 +815,7 @@ If the browser doesn’t open automatically during login, press `c` to copy the OAuth URL to your clipboard, then paste it into a browser manually. This also works when the URL wraps across lines in a narrow or SSH terminal and can’t be clicked directly. -### - -​ - -OAuth error: Invalid code +### OAuth error: Invalid code If you see `OAuth error: Invalid code. Please make sure the full code was copied`, the login code expired or was truncated during copy-paste. **Solutions:** @@ -1003,11 +823,7 @@ * Type `c` to copy the full URL if the browser doesn’t open automatically * If using a remote/SSH session, the browser may open on the wrong machine. Copy the URL displayed in the terminal and open it in your local browser instead. -### - -​ - -403 Forbidden after login +### 403 Forbidden after login If you see `API Error: 403 Request not allowed` after logging in: @@ -1015,22 +831,14 @@ * **Anthropic Console users** : confirm your account has the “Claude Code” or “Developer” role. Admins assign this on the Console’s Members page at [platform.claude.com/settings/members](<https://platform.claude.com/settings/members>). * **Behind a proxy** : corporate proxies can interfere with API requests. See [network configuration](</docs/en/network-config>) for proxy setup. -### - -​ - -Claude Code access has not been granted for this account +### Claude Code access has not been granted for this account If the sign-in page shows `Authorization failed` with the message `Claude Code access has not been granted for this account. Contact your administrator.` after you log in from Claude Code, your Claude Enterprise organization has set your role to Custom and none of the [custom roles](<https://support.claude.com/en/articles/13930452>) assigned to your groups grants Claude Code. On the Custom role, you get access only from those custom roles, so nothing you change in Claude Code resolves this error. To get access: 1. Ask an Owner of your Claude organization to assign a custom role that grants Claude Code access to one of your groups, or to change your role from Custom to a standard role such as User. Owners manage roles in the organization’s [role settings](<https://claude.ai/admin-settings/roles>). 2. After the Owner makes the change, run `claude` and log in again. -### - -​ - -This organization has been disabled with an active subscription +### This organization has been disabled with an active subscription If you see `API Error: 400 ... "This organization has been disabled"` despite having an active Claude subscription, an `ANTHROPIC_API_KEY` environment variable is overriding your subscription. This commonly happens when an old API key from a previous employer or project is still set in your shell profile. When `ANTHROPIC_API_KEY` is present and you have approved it, Claude Code uses that key instead of your subscription’s OAuth credentials. In non-interactive mode with the `-p` flag, the key is always used when present. See [authentication precedence](</docs/en/authentication#authentication-precedence>) for the full resolution order. To use your subscription instead, unset the environment variable and remove it from your shell profile: @@ -1046,11 +854,7 @@ Check `~/.zshrc`, `~/.bashrc`, or `~/.profile` for `export ANTHROPIC_API_KEY=...` lines and remove them to make the change permanent. On Windows, check your PowerShell profile at `$PROFILE` and your User environment variables for `ANTHROPIC_API_KEY`. Run `/status` inside Claude Code to confirm which authentication method is active. -### - -​ - -OAuth login fails in WSL2, SSH, or containers +### OAuth login fails in WSL2, SSH, or containers If no browser opens, or the browser signs you in and then shows a connection error for a `localhost` address, you can finish signing in without fixing either problem. Sign in through the separate login URL that the terminal shows above its paste prompt instead: @@ -1081,11 +885,7 @@ export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe" claude -### - -​ - -Not logged in or token expired +### Not logged in or token expired If Claude Code prompts you to log in again after a session, your OAuth token may have expired. Run `/login` to re-authenticate. If this happens frequently, check that your system clock is accurate, as token validation depends on correct timestamps. Parallel sessions on one machine share a saved login and coordinate its renewal so that only one process refreshes the token at a time. For what the other sessions do after you sign in again in one of them, see [Not logged in](</docs/en/errors#not-logged-in>). Before v2.1.211, waking the machine from sleep could cause two sessions to renew with the same token, which revoked the saved login and prompted every open session to log in again at once. On macOS, Claude Code saves credentials to the login Keychain. When the Keychain rejects the write, such as when it’s locked in an SSH session or its password is out of sync with your account password, Claude Code saves your login to the plaintext `~/.claude/.credentials.json` file instead. A Console login that creates an API key fails until the Keychain is writable again. To make the Keychain writable again and move your login back into the encrypted Keychain: @@ -1115,11 +915,7 @@ Once the Keychain is writable again, Claude Code moves the credentials back the next time it writes a credential. To force it now, run `/logout` and then `/login`. Logging out removes all stored credentials, including the plaintext file’s contents, saved MCP server logins, and plugin sensitive values, so expect to re-authorize MCP servers and re-enter plugin secrets afterwards. Logging in again stores your login in the Keychain. -#### - -​ - -Login fails on a network home directory +#### Login fails on a network home directory When a request fails with `API Error: 401` and your [configuration directory](</docs/en/claude-directory>) is on a network filesystem, check whether that filesystem or your quota on it is full. With no room left, Claude Code can’t save a new or renewed login to the plaintext [`.credentials.json` file](</docs/en/authentication#credential-management>), and `claude auth login` can still print `Login successful.` @@ -1137,11 +933,7 @@ Before v2.1.318, when Claude Code saved the login file on a full network filesystem, it could replace a still-valid stored login with an empty file. Later commands then reported `Not logged in`. -### - -​ - -Bedrock, Agent Platform, or Foundry credentials not loading +### Bedrock, Agent Platform, or Foundry credentials not loading If you configured Claude Code to use a cloud provider and see `Could not load credentials from any providers` on Amazon Bedrock, `Could not load the default credentials` on Google Cloud’s Agent Platform, or `ChainedTokenCredential authentication failed` on Microsoft Foundry, your cloud provider CLI is likely not authenticated in the current shell. For Amazon Bedrock, confirm your AWS credentials are valid: @@ -1157,11 +949,7 @@ If credentials work in your terminal but not in the VS Code or JetBrains extension, the IDE process likely didn’t inherit your shell environment. Set the provider environment variables in the IDE’s own settings, or launch the IDE from a terminal where they’re already exported. See [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>) for full provider setup. -## - -​ - -Still stuck +## Still stuck If none of the above resolves your issue:
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -25,7 +25,7 @@ `EACCES: permission denied` during install| Fix the install directory’s permissions `TLS connect error` or `SSL/TLS secure channel`| Update CA certificates `CRYPT_E_NO_REVOCATION_CHECK` or `CRYPT_E_REVOCATION_OFFLINE`| Work around blocked revocation checks -`Failed to fetch version` or can’t reach download server| Check network and proxy settings +`Failed to fetch version` or can’t reach download server| Check network and proxy settings, or for a certificate error, configure corporate CA certificates `The connection dropped while downloading the update` or `Download timed out: exceeded the total deadline`| Run the update again or set your proxy `Release verification failed for Claude Code`| Run `claude update` or `claude install` again `Auto-update failed · Run claude doctor` in red in the session footer| Run `claude update` from your shell @@ -92,11 +92,11 @@ * `403`: usually a proxy or network filter blocking the host, or Claude Code is [not available in your region](<https://www.anthropic.com/supported-countries>) * `5xx`: usually a temporary service issue; wait a few minutes and retry -If you see no output, `Could not resolve host`, or a connection timeout, your network is blocking the connection. Common causes: +If you see no output, or the installer shows `Could not resolve host` or a connection timeout, the connection failed, so check for these causes: * Corporate firewalls or proxies blocking `downloads.claude.ai` * Regional network restrictions: try a VPN or alternative network - * TLS/SSL issues: update your system’s CA certificates, or check if `HTTPS_PROXY` is configured + * TLS/SSL issues: see TLS or SSL connection errors If you’re behind a corporate proxy, set `HTTPS_PROXY` and `HTTP_PROXY` to your proxy’s address before installing. Ask your IT team for the proxy URL if you don’t know it, or check your browser’s proxy settings. This example sets both proxy variables, then runs the installer through your proxy: @@ -467,13 +467,19 @@ irm https://claude.ai/install.ps1 | iex - 3. **Check for proxy or firewall interference** : corporate proxies that perform TLS inspection can cause these errors, including `unable to get local issuer certificate` and `SELF_SIGNED_CERT_IN_CHAIN`. For the install step, make the install download trust your corporate proxy’s CA: + 3. **Check for proxy or firewall interference** : corporate proxies that perform TLS inspection can cause these errors, including `unable to get local issuer certificate`, `unable to verify the first certificate`, and `SELF_SIGNED_CERT_IN_CHAIN`. Make the install download trust your corporate proxy’s CA: * macOS/Linux * Windows PowerShell - curl --cacert /path/to/corporate-ca.pem -fsSL https://claude.ai/install.sh | bash +Set `CURL_CA_BUNDLE` for the install script’s `curl` downloads, and [`NODE_EXTRA_CA_CERTS`](</docs/en/network-config#custom-ca-certificates>) for the `claude install` command the script then runs. Ask your IT team for a PEM file with your proxy’s root CA certificate if you don’t have it. This example sets both to your proxy’s CA file and runs the script in the same terminal: + + export CURL_CA_BUNDLE=/path/to/corporate-ca.pem + export NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem + curl -fsSL https://claude.ai/install.sh | bash + +If the install still fails with one of those certificate errors, ask your IT team for a file with both the public root certificates and your proxy’s full CA chain. Then set both variables to that file. The PowerShell installer downloads through .NET, which validates TLS against the Windows certificate store. Ask your IT team to add the proxy’s CA certificate to the Windows store if it isn’t already there, then run the installer: @@ -489,7 +495,6 @@ $env:NODE_EXTRA_CA_CERTS = 'C:\path\to\corporate-ca.pem' -Ask your IT team for the certificate file if you don’t have it. You can also try on a direct connection to confirm the proxy is the cause. 4. **On Windows, work around blocked revocation checks**. The errors `CRYPT_E_NO_REVOCATION_CHECK (0x80092012)` and `CRYPT_E_REVOCATION_OFFLINE (0x80092013)` mean curl reached the server but your network blocks the certificate revocation lookup, which is common behind corporate firewalls. If the failing command is the `curl` that downloads `install.cmd`, rerun it from a Command Prompt with `--ssl-revoke-best-effort` added: curl --ssl-revoke-best-effort -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd @@ -506,7 +511,7 @@ `Failed to fetch version from downloads.claude.ai` -The installer couldn’t reach the download server. This typically means `downloads.claude.ai` is blocked on your network. See Check network connectivity. +The end of the message gives the reason. If it’s a certificate error such as `unable to verify the first certificate`, see TLS or SSL connection errors. For any other reason, see Check network connectivity. ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -1110,6 +1110,28 @@ Once the Keychain is writable again, Claude Code moves the credentials back the next time it writes a credential. To force it now, run `/logout` and then `/login`. Logging out removes all stored credentials, including the plaintext file’s contents, saved MCP server logins, and plugin sensitive values, so expect to re-authorize MCP servers and re-enter plugin secrets afterwards. Logging in again stores your login in the Keychain. +#### + +​ + +Login fails on a network home directory + +When a request fails with `API Error: 401` and your [configuration directory](</docs/en/claude-directory>) is on a network filesystem, check whether that filesystem or your quota on it is full. With no room left, Claude Code can’t save a new or renewed login to the plaintext [`.credentials.json` file](</docs/en/authentication#credential-management>), and `claude auth login` can still print `Login successful.` + +1 + +Make room on the filesystem + +Delete files you no longer need on the filesystem that holds `~/.claude`, or the directory you set in [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>). + +2 + +Sign in again + +Run `/login` at the Claude Code prompt or `claude auth login` in your shell. + +Before v2.1.318, when Claude Code saved the login file on a full network filesystem, it could replace a still-valid stored login with an empty file. Later commands then reported `Not logged in`. + ### ​
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -1006,7 +1006,7 @@ If you see `API Error: 403 Request not allowed` after logging in: - * **Claude Pro/Max users** : verify your subscription is active at [claude.ai/settings](<https://claude.ai/settings>) + * **Claude Pro/Max/Ultra users** : verify your subscription is active at [claude.ai/settings](<https://claude.ai/settings>) * **Anthropic Console users** : confirm your account has the “Claude Code” or “Developer” role. Admins assign this on the Console’s Members page at [platform.claude.com/settings/members](<https://platform.claude.com/settings/members>). * **Behind a proxy** : corporate proxies can interfere with API requests. See [network configuration](</docs/en/network-config>) for proxy setup.
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -853,7 +853,7 @@ npm install errors in WSL -These issues apply if you installed Claude Code with `npm install -g` inside WSL. If you used the [native installer](</docs/en/setup>), skip this section. **OS or platform detection issues.** If npm reports a platform mismatch during install, WSL is likely picking up the Windows `npm`. Run `npm config set os linux` first, then install with `npm install -g @anthropic-ai/claude-code --force`. Do not use `sudo`. **`exec: node: not found` when running `claude`.** Your WSL environment is likely using the Windows installation of Node.js. Confirm with `which npm` and `which node`: paths starting with `/mnt/c/` are Windows binaries, while Linux paths start with `/usr/`. To fix this, install Node via your Linux distribution’s package manager or via [`nvm`](<https://github.com/nvm-sh/nvm>). **nvm version conflicts.** If you have nvm installed in both WSL and Windows, switching Node versions in WSL may break because WSL imports the Windows PATH by default and the Windows nvm takes priority. The most common cause is that nvm isn’t loaded in your shell. Add the nvm loader to `~/.bashrc` or `~/.zshrc`: +These issues apply if you installed Claude Code with `npm install -g` inside WSL. If you used the [native installer](</docs/en/setup>), skip this section. On npm 12, install as Fix an npm 12 install describes. **OS or platform detection issues.** If npm reports a platform mismatch during install, WSL is likely picking up the Windows `npm`. Run `npm config set os linux` first, then install with `npm install -g @anthropic-ai/claude-code --force`. Do not use `sudo`. **`exec: node: not found` when running `claude`.** Your WSL environment is likely using the Windows installation of Node.js. Confirm with `which npm` and `which node`: paths starting with `/mnt/c/` are Windows binaries, while Linux paths start with `/usr/`. To fix this, install Node via your Linux distribution’s package manager or via [`nvm`](<https://github.com/nvm-sh/nvm>). **nvm version conflicts.** If you have nvm installed in both WSL and Windows, switching Node versions in WSL may break because WSL imports the Windows PATH by default and the Windows nvm takes priority. The most common cause is that nvm isn’t loaded in your shell. Add the nvm loader to `~/.bashrc` or `~/.zshrc`: export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" @@ -885,7 +885,7 @@ Native binary not found after npm install -The `@anthropic-ai/claude-code` npm package downloads the native binary as a per-platform optional dependency, such as `@anthropic-ai/claude-code-darwin-arm64`. npm then runs the package’s postinstall script, which copies that binary into place as the `claude` command; until it runs, `claude` is a placeholder script. If either the download or the postinstall step is skipped, the placeholder stays in place, and running `claude` on macOS and Linux prints: +The `@anthropic-ai/claude-code` npm package downloads the native binary as a per-platform optional dependency, such as `@anthropic-ai/claude-code-darwin-arm64`. `claude` is a placeholder script until the `@anthropic-ai/claude-code` package’s postinstall step runs and replaces the placeholder with that binary. If either the download or the postinstall step is skipped, the placeholder stays in place, and running `claude` on macOS and Linux prints: Error: claude native binary not installed. @@ -900,10 +900,34 @@ On Windows, `bin/claude.exe` is that same shell-script placeholder rather than a real executable, so PowerShell and CMD report that they can’t run the file instead of printing this message. Check the following causes: + * **npm 12 skips the postinstall step by default.** When you install or update Claude Code with npm 12, npm still finishes the install without running the step. See Fix an npm 12 install. * **Optional dependencies are disabled.** Remove `--omit=optional` from your npm install command, `--no-optional` from pnpm, or `--ignore-optional` from yarn, and check that `.npmrc` does not set `optional=false`. Then reinstall. The native binary is delivered only as an optional dependency, so there is no JavaScript fallback if it is skipped, and running `install.cjs` again can’t place a binary that was never downloaded. * **Install scripts are disabled.** `--ignore-scripts` and some pnpm configurations skip the postinstall step but still download the platform package. Run `node node_modules/@anthropic-ai/claude-code/install.cjs` as the message suggests, or reinstall without the flag. If postinstall can’t run in your environment at all, `node node_modules/@anthropic-ai/claude-code/cli-wrapper.cjs` finds the downloaded package and launches it, at the cost of an extra Node process on each start. If the wrapper prints `Could not find native binary package` instead, the platform package was never downloaded, so fix the optional-dependencies cause above first. * **Unsupported platform.** Prebuilt binaries are published for `darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `linux-x64-musl`, `linux-arm64-musl`, `win32-x64`, and `win32-arm64`. Claude Code does not ship a binary for other platforms; see the [system requirements](</docs/en/setup#system-requirements>). On FreeBSD, the installer reports the platform as unsupported. Before v2.1.205, it treated FreeBSD as Linux and downloaded a binary that couldn’t run. * **Corporate npm mirror is missing the platform packages.** Ensure your registry mirrors all eight `@anthropic-ai/claude-code-*` platform packages in addition to the meta package. + +#### + +​ + +Fix an npm 12 install + +If `claude` prints `Error: claude native binary not installed.` after an npm install or update, or on Windows the shell can’t run it, run `npm --version`. A version starting with `12` means that, unless your npm config allows it, npm skipped Claude Code’s postinstall step, which puts the binary in place. For any other version, check the other causes. To fix an npm 12 install, switch to the native installer or allow the step: + + * **Switch to the native installer** : [install with the native installer](</docs/en/setup#install-claude-code>), then [uninstall the npm package](</docs/en/setup#uninstall-with-npm>). Updates then don’t use npm, so the error doesn’t come back. + * **Stay on npm** : for a global npm install, add Claude Code to `allow-scripts` in your user npm config. npm then runs Claude Code’s install scripts on every later install and update, and in project installs whose `package.json` sets no `allowScripts`. Use the native installer for a local install in `~/.claude/local`. Also use it if your `package.json` scripts call `npm install` and you run them with pnpm 9, pnpm 10, Yarn 1 or another tool that passes them this setting. On npm 12.1 and later, those installs can fail with `EALLOWSCRIPTS` once the setting is saved. + 1. If `npm --version` printed 12.0.x, update npm to 12.1 or later, for example with `npm install -g npm@latest`. On 12.0.x, project installs that an `npx` tool or an `npm run` script starts can fail with `EALLOWSCRIPTS` once the setting is saved. + 2. Run `npm config get allow-scripts` and note any packages it lists, because the next command replaces the whole value. Save the setting with those packages inside the quotes, as in `"allow-scripts=@anthropic-ai/claude-code,<package>"`: + + npm config set "allow-scripts=@anthropic-ai/claude-code" --location=user + + 3. Reinstall: + + npm install -g @anthropic-ai/claude-code + +If this or step 1 fails with `EACCES`, switch to the native installer instead of rerunning it with `sudo`. Claude Code runs npm without `sudo` when it updates itself, so automatic updates would fail the same way. + 4. If `claude --version` doesn’t print a version number, check the other causes. +To undo, set the list again without `@anthropic-ai/claude-code`, or remove the whole list with `npm config delete allow-scripts --location=user`. On npm 12, the error then returns after your next update. ### @@ -934,7 +958,7 @@ Remove-Item -Recurse -Force "$(npm root -g)/@anthropic-ai/claude-code", "$(npm root -g)/@anthropic-ai/.claude-code-*" -Then reinstall: +Then reinstall. On npm 12, follow Fix an npm 12 install. Otherwise, run: npm install -g @anthropic-ai/claude-code
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -1023,16 +1023,34 @@ OAuth login fails in WSL2, SSH, or containers -When Claude Code runs in WSL2, on a remote machine over SSH, or inside a container, the browser usually opens on a different host and its redirect can’t reach Claude Code’s local callback server. After you sign in, the browser shows a login code instead of redirecting back automatically. Paste that code into the terminal at the `Paste code here if prompted` prompt to complete login. If the browser doesn’t open at all from WSL2, set the `BROWSER` environment variable to your Windows browser path: +If no browser opens, or the browser signs you in and then shows a connection error for a `localhost` address, you can finish signing in without fixing either problem. Sign in through the separate login URL that the terminal shows above its paste prompt instead: + +1 + +Copy the login URL + +At the interactive login prompt, press `c` to copy the URL, or select it in the terminal. With `claude auth login`, copy the URL that it prints. + +2 + +Sign in through that URL + +Open the URL in a browser on your local machine and sign in. The browser then shows a code instead of returning to `localhost`. + +3 + +Paste the code + +Paste that code into the terminal at the prompt that begins `Paste code here`. + +If pasting the code into the interactive prompt does nothing, your terminal’s paste binding likely isn’t reaching the input field. Try your terminal’s alternate paste shortcut, often right-click or Shift+Insert in Windows Terminal, or use `claude auth login` instead, which reads the pasted code from standard input: + + claude auth login + +This fallback also applies on native Windows or any terminal where pasting into the interactive prompt fails. On WSL2, if no browser opened, you can also let Claude Code open your Windows browser next time by setting the `BROWSER` environment variable to that browser’s path: export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe" claude - -Alternatively, press `c` at the interactive login prompt to copy the OAuth URL, or copy the URL that `claude auth login` prints, and open it in a browser on your local machine. If pasting the code into the interactive prompt does nothing, your terminal’s paste binding likely isn’t reaching the input field. Try your terminal’s alternate paste shortcut, often right-click or Shift+Insert in Windows Terminal, or use `claude auth login` instead, which reads the pasted code from standard input: - - claude auth login - -This fallback also applies on native Windows or any terminal where pasting into the interactive prompt fails. ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -27,6 +27,8 @@ `CRYPT_E_NO_REVOCATION_CHECK` or `CRYPT_E_REVOCATION_OFFLINE`| Work around blocked revocation checks `Failed to fetch version` or can’t reach download server| Check network and proxy settings `The connection dropped while downloading the update` or `Download timed out: exceeded the total deadline`| Run the update again or set your proxy +`Release verification failed for Claude Code`| Run `claude update` or `claude install` again +`Auto-update failed · Run claude doctor` in red in the session footer| Run `claude update` from your shell `irm is not recognized` or `The token '&&' is not a valid statement separator`| Use the right command for your shell `Cask 'claude-code' is unavailable: No Cask with this name exists`| Update Homebrew `Cask 'claude-code@latest' is not installed`| Upgrade the cask you installed @@ -527,6 +529,31 @@ ​ +Release verification failed for Claude Code + +This message from `claude update` or `claude install` means Claude Code couldn’t confirm that the release it was about to install is genuine, so it installed nothing. Any version you already have keeps working. + + Release verification failed for Claude Code <version> (<reason>). The update was not installed. + +Take the step that matches the value in parentheses in your message: + + * **A value that starts with`sidecar_fetch_`**: run the same command again from your shell. `claude update` succeeded if it prints a line that starts with `Successfully updated from`, and `claude install` succeeded if it prints `Claude Code successfully installed!`. + * **Any other value** : try the same command again later + +With any value, if the message repeats, report the problem and include the full message. + +### + +​ + +`Auto-update failed · Run claude doctor` in the session footer + +This red line means Claude Code tried to update itself in the background and the update didn’t install. You can keep working without doing anything. The line points you to `claude doctor`, whose `Last update attempt: failed (install_failed)` line gives a date but no cause. To finish the update or see why it failed, run `claude update` in your shell instead. If that install fails too, look for the error `claude update` prints under Find your error. + +### + +​ + Wrong install command on Windows If you see `'irm' is not recognized`, `The token '&&' is not a valid statement separator`, `A parameter cannot be found that matches parameter name 'fsSL'`, or `'bash' is not recognized as the name of a cmdlet`, you copied the install command for a different shell or operating system. If the command prints the script’s text instead of installing anything, you ran only part of it.
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -956,7 +956,7 @@ If you see `API Error: 403 Request not allowed` after logging in: * **Claude Pro/Max users** : verify your subscription is active at [claude.ai/settings](<https://claude.ai/settings>) - * **Anthropic Console users** : confirm your account has the “Claude Code” or “Developer” role. Admins assign this in the Anthropic Console under Settings → Members. + * **Anthropic Console users** : confirm your account has the “Claude Code” or “Developer” role. Admins assign this on the Console’s Members page at [platform.claude.com/settings/members](<https://platform.claude.com/settings/members>). * **Behind a proxy** : corporate proxies can interfere with API requests. See [network configuration](</docs/en/network-config>) for proxy setup. ###
modified
Show diff (316 lines)
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -11,16 +11,25 @@ What you see| Solution ---|--- `command not found: claude` or `'claude' is not recognized`| Fix your PATH +`Native installation exists but ... is not in your PATH`| Add the install directory to your PATH +`INFO: Could not find files for the given pattern(s).` from `where.exe claude`| Check whether Claude Code is installed +`zsh: permission denied: /Users/you/.zshrc` or `bash: /home/you/.bashrc: Permission denied`| Make your shell config file writable `syntax error near unexpected token '<'`| Install script returns HTML +`< was unexpected at this time` in CMD| Install script returns HTML +`The term 'System.Xml.XmlDocument' is not recognized`| Install script returns HTML `curl: (22) The requested URL returned error: 403`| Install script returned 403 `curl: (23)` or `curl: (56) Failure writing output to destination`| Check connectivity or use an alternative installer -`Killed` during install on Linux, or `Installation was killed before it could finish (exit code 137)`| Free memory or add swap space +`Killed` during install on Linux| Free memory or add swap space +`Installation was killed before it could finish`| Free memory, then rerun the installer `Raw mode is not supported` during install| Rerun the installer `EACCES: permission denied` during install| Fix the install directory’s permissions `TLS connect error` or `SSL/TLS secure channel`| Update CA certificates +`CRYPT_E_NO_REVOCATION_CHECK` or `CRYPT_E_REVOCATION_OFFLINE`| Work around blocked revocation checks `Failed to fetch version` or can’t reach download server| Check network and proxy settings +`The connection dropped while downloading the update` or `Download timed out: exceeded the total deadline`| Run the update again or set your proxy `irm is not recognized` or `The token '&&' is not a valid statement separator`| Use the right command for your shell `Cask 'claude-code' is unavailable: No Cask with this name exists`| Update Homebrew +`Cask 'claude-code@latest' is not installed`| Upgrade the cask you installed `'bash' is not recognized as the name of a cmdlet`| Use the Windows installer command `A parameter cannot be found that matches parameter name 'fsSL'`| Use the Windows installer command `Claude Code on Windows requires either Git for Windows (for bash) or PowerShell`| Install a shell @@ -107,11 +116,11 @@ Verify your PATH -If installation succeeded but you get a `command not found` or `not recognized` error when running `claude`, the install directory isn’t in your PATH. Your shell searches for programs in directories listed in PATH, and the installer places `claude` at `~/.local/bin/claude` on macOS/Linux or `%USERPROFILE%\.local\bin\claude.exe` on Windows. +If installation succeeded but you get a `command not found` or `not recognized` error when running `claude`, the install directory isn’t in your PATH. Your shell searches for programs in directories listed in PATH, and the installer places `claude` at `~/.local/bin/claude` on macOS/Linux or `%USERPROFILE%\.local\bin\claude.exe` on Windows. The installer detects this case and reports it under `Setup notes:` in its output: `Native installation exists but ~/.local/bin is not in your PATH.` on macOS and Linux, or `Native installation exists but C:\Users\you\.local\bin is not in your PATH.` on Windows. It prints the fix with that note but doesn’t change PATH itself. The [VS Code extension](</docs/en/vs-code>) does not place `claude` at this location. It bundles a private copy of the CLI inside the extension directory for its own chat panel and does not add it to PATH. If you have only installed the extension, `~/.local/bin/claude` will not exist. Run the [standalone install](</docs/en/setup>) to use `claude` from a terminal, then continue below. -Check if the install directory is in your PATH by listing your PATH entries and filtering for `local/bin`: +First check that the program is there at all, then check whether its folder is in your PATH. The PATH fix is permanent, so you apply it once. Pick your platform’s tab and run its commands there: in your terminal on macOS and Linux, or in PowerShell or Command Prompt on Windows. * macOS/Linux @@ -119,9 +128,18 @@ * Windows CMD +Check that the installer put the program in place: + + ls -la ~/.local/bin/claude + + * **`No such file or directory`** : there’s no native install. If you haven’t installed Claude Code another way, such as with npm, Homebrew, or a Linux package manager, [install Claude Code](</docs/en/setup#install-claude-code>). If you installed it another way, see Check for conflicting installations. + * **A listing for the file** : the program is there. Check your PATH next. + +List your PATH entries and filter for the install folder: + echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin" -If this prints `/Users/you/.local/bin` or `/home/you/.local/bin`, the directory is in your PATH and you can skip to Check for conflicting installations. If there’s no output, add it to your shell configuration.For Zsh, the default on macOS: +If this prints `/Users/you/.local/bin` or `/home/you/.local/bin`, the directory is in your PATH and you can skip to Check for conflicting installations. If there’s no output, add it to your shell configuration with the two commands for your shell. The `echo` command saves the setting for every new terminal, and `source` applies it to the window you’re in. The `echo` command prints nothing when it succeeds.For Zsh, the default on macOS: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc source ~/.zshrc @@ -136,13 +154,28 @@ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bash_profile source ~/.bash_profile -Alternatively, close and reopen your terminal.For other shells such as fish or Nushell, add `~/.local/bin` to your PATH using your shell’s own configuration syntax, then restart your terminal.Verify the fix worked: +Alternatively, close and reopen your terminal.If the `echo` command prints `permission denied`, see `permission denied` when adding to your PATH.For other shells such as fish or Nushell, add `~/.local/bin` to your PATH using your shell’s own configuration syntax, then restart your terminal.Verify the fix worked: claude --version +If `claude` is still not found, check these causes: + + * **The terminal predates the change** : a window that was already open keeps its old PATH, and a terminal inside an editor takes its PATH from the editor. Open a new window, or quit and reopen the editor. + * **The line wasn’t saved** : run `grep -n '.local/bin' ~/.zshrc`, using your shell’s file name. It prints the line with its line number when the line is there. If it prints nothing, run the two PATH commands again. + * **The line went to another shell’s file** : run `echo $0` to see your shell, then run the two PATH commands for that shell. + +Check that the installer put the program in place: + + Test-Path "$env:USERPROFILE\.local\bin\claude.exe" + + * **`False`** : there’s no native install. If you haven’t installed Claude Code another way, such as with npm or WinGet, [install Claude Code](</docs/en/setup#install-claude-code>). If you installed it another way, see Check for conflicting installations. + * **`True`** : the program is there. Check your PATH next. + +List your PATH entries and filter for the install folder: + $env:PATH -split ';' | Select-String '\.local\\bin' -If there’s no output, add the install directory to your User PATH: +If this prints `C:\Users\you\.local\bin`, the directory is in your PATH and you can skip to Check for conflicting installations. If there’s no output, add the install directory to your User PATH: $currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User') [Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User') @@ -151,12 +184,28 @@ claude --version +If `claude` is still not found in a new terminal, check these causes: + + * **The terminal runs inside an editor** : it takes its PATH from the editor, so quit and reopen the editor. + * **The change wasn’t saved** : run `[Environment]::GetEnvironmentVariable('PATH', 'User')` and look for `.local\bin` in the PATH it prints. If it’s missing, run the two commands again. + +Check that the installer put the program in place: + + dir "%USERPROFILE%\.local\bin\claude.exe" + + * **`File Not Found` or `The system cannot find the path specified.`**: there’s no native install. If you haven’t installed Claude Code another way, such as with npm or WinGet, [install Claude Code](</docs/en/setup#install-claude-code>). If you installed it another way, see Check for conflicting installations. + * **A listing for`claude.exe`**: the program is there. Check your PATH next. + +List your PATH entries and filter for the install folder: + echo %PATH% | findstr /i "local\bin" If there’s no output, open System Settings, go to Environment Variables, and add `%USERPROFILE%\.local\bin` to your User PATH variable. Restart your terminal.Verify the fix worked: claude --version +If `claude` is still not found in a new terminal, a terminal inside an editor takes its PATH from the editor, so quit and reopen the editor too. + ### ​ @@ -173,7 +222,7 @@ which -a claude -If this prints nothing, no `claude` is on your PATH yet. Go back to Verify your PATH.Check the three locations a `claude` binary can come from. `~/.local/bin/claude` is the native installer, `~/.claude/local/` is a legacy local npm install created by older versions of Claude Code, and the npm global list shows a `-g` install: +If this prints `claude not found`, a `no claude in` line, or nothing, no `claude` is on your PATH. The next checks show whether one is installed at all.Check the three locations a `claude` binary can come from. `~/.local/bin/claude` is the native installer, `~/.claude/local/` is a legacy local npm install created by older versions of Claude Code, and the npm global list shows a `-g` install: ls -la ~/.local/bin/claude @@ -183,13 +232,18 @@ npm -g ls @anthropic-ai/claude-code 2>/dev/null +If `ls -la ~/.local/bin/claude` printed `No such file or directory`, there’s no native install. If you haven’t installed Claude Code another way, such as with npm, Homebrew, or a Linux package manager, [install Claude Code](</docs/en/setup#install-claude-code>). If `~/.local/bin/claude` exists but `which -a claude` didn’t list it, the folder isn’t in your PATH: see Verify your PATH. + List all `claude` binaries found in your PATH: where.exe claude -Check whether the native installer placed a binary: +If this prints `INFO: Could not find files for the given pattern(s).`, no `claude` is on your PATH.Check whether the native installer placed a binary: Test-Path "$env:USERPROFILE\.local\bin\claude.exe" + + * **`True`** : the native install is there. If `where.exe` found nothing, its folder isn’t in your PATH: see Verify your PATH. + * **`False`** : there’s no native install. If you haven’t installed Claude Code another way, such as with npm or WinGet, [install Claude Code](</docs/en/setup#install-claude-code>). If you find multiple installations, keep only one. The native install at `~/.local/bin/claude` on macOS/Linux or `%USERPROFILE%\.local\bin\claude.exe` on Windows is recommended. Remove the extras: Uninstall an npm global install: @@ -276,25 +330,37 @@ Install script returns HTML instead of a shell script -When running the install command, you may see one of these errors: +The install command fails with one of these errors when what it downloaded isn’t the install script. **Bash or Zsh** : the error quotes the first line of the returned page. bash: line 1: syntax error near unexpected token `<' bash: line 1: `<!DOCTYPE html>' -On PowerShell, the same problem appears as parse errors pointing into the returned page, with `iex` trying to run HTML and CSS as PowerShell: +**PowerShell, parse errors** : the errors point into the returned page, with `iex` trying to run HTML and CSS as PowerShell. iex : At line:1 char:2310 + ... igin="anonymous"/><script type="text/javascript">!function(o,c){var n ... Missing argument in parameter list. ... -The wording varies with the PowerShell version and system language: you may see `Missing expression after unary operator '--'` or a `ParserError` with `ParseException` instead. HTML tags or CSS in the quoted text identify this failure. If you download with `-OutFile install.ps1` instead, the saved file is the same web page, so that doesn’t help either. Depending on how the request was routed, you may instead see a 403 with no HTML body: +The wording varies with the PowerShell version and system language: you may see `Missing expression after unary operator '--'` or a `ParserError` with `ParseException` instead. HTML tags or CSS in the quoted text identify this failure. If you download with `-OutFile install.ps1` instead, the saved file is the same web page, so that doesn’t help either. **PowerShell,`System.Xml.XmlDocument`**: the error names this type instead of quoting the page. + + System.Xml.XmlDocument : The term 'System.Xml.XmlDocument' is not recognized as the name of a cmdlet, function, script + file, or operable program. + +When `irm` can parse the response as XML, it returns an XML object instead of text, and `iex` then tries to run that object’s type name as a command. The install script is PowerShell code and doesn’t parse as XML, so this error also means the response was something other than the script. The wording around the type name varies with the PowerShell version and system language, but `System.Xml.XmlDocument` itself stays the same, so match on the type name. **CMD** : you see this error, followed by the HTML of the returned page. + + < was unexpected at this time. + + C:\Users\you><!DOCTYPE html>... + +The first line appears in your system language, so look for the HTML that follows it. **A 403 with no page** : depending on how the request was routed, curl reports a 403 status with no HTML body. curl: (22) The requested URL returned error: 403 -These all mean the install URL returned an HTML page or an error status instead of the install script. If the HTML page says “App unavailable in region,” Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). A bare 403 with no body often has the same cause, but it can also come from a corporate proxy or firewall blocking the download. If you are in a supported country and still see the 403, work through Check network connectivity before trying the alternative installers below, since those reach the same hosts. Otherwise, this can happen due to network issues, regional routing, or a temporary service disruption. **Solutions:** - - 1. **Use an alternative install method** : On macOS, install via Homebrew: +These all mean the install URL returned a web page, an XML document, or an error status instead of the install script. If the error output quotes “App unavailable in region,” Claude Code isn’t available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). A bare 403 with no body often has the same cause, but it can also come from a corporate proxy or firewall blocking the download. If you are in a supported country and still see the 403, work through Check network connectivity before trying the alternative installers below, since those reach the same hosts. Otherwise, this can happen due to network issues, regional routing, or a temporary service disruption. **Solutions:** + + 1. **Retry after a few minutes** : the issue is often temporary. Wait and try the original command again. + 2. **Use an alternative install method** : unlike a native install, a Homebrew or WinGet install [doesn’t update itself by default](</docs/en/setup#auto-updates>). On macOS, install via Homebrew: brew install --cask claude-code @@ -303,7 +369,6 @@ winget install Anthropic.ClaudeCode Then run `claude --version` to confirm: the command prints a version number such as `2.1.211 (Claude Code)`. If the shell reports `claude` isn’t found, open a new terminal window and retry: the session you installed from keeps its old `PATH`. - 2. **Retry after a few minutes** : the issue is often temporary. Wait and try the original command again. ### @@ -326,6 +391,23 @@ ​ +`permission denied` when adding to your PATH + +If the `echo` command that adds `~/.local/bin` to your PATH prints `zsh: permission denied: /Users/you/.zshrc` or `bash: /home/you/.bashrc: Permission denied`, your user can’t write to that file and nothing was saved. In your terminal, check who owns the file, using your shell’s file name in place of `~/.zshrc`: + + ls -l ~/.zshrc + +The third field of the output is the owner. + + * **The owner is another user, such as`root`**: take ownership with `sudo chown $(whoami) ~/.zshrc`, which requires administrator rights. + * **The owner is you** : the file is read-only. Make it writable with `chmod u+w ~/.zshrc`. + +Then run the two PATH commands for your shell in Verify your PATH again. + +### + +​ + `curl: (56) Failure writing output to destination` The `curl ... | bash` command downloads the script and pipes it to Bash for execution. This error, and the related `curl: (23) Failure writing output to destination`, means Bash did not receive the complete script. Exit code 56 indicates the download itself was interrupted, and exit code 23 indicates curl could not write what it received to the pipe, usually because Bash exited early. Test that you can reach `downloads.claude.ai` with the check in Check network connectivity. If you reached the server, the original failure was likely intermittent; retry the install command. You can also [try an alternative install method](</docs/en/setup#install-claude-code>). @@ -342,6 +424,18 @@ brew install --cask claude-code If Homebrew installs an older Claude Code version than you expect, the same stale index is usually the cause. The `claude-code` cask tracks the stable channel and is typically about one week behind the latest release; for the newest version run `brew install --cask claude-code@latest` instead. See [Configure release channel](</docs/en/setup#configure-release-channel>) for the difference between the two casks. + +### + +​ + +`Cask 'claude-code@latest' is not installed` + +Homebrew offers two casks, `claude-code` and `claude-code@latest`. Running `brew upgrade --cask claude-code@latest` when that cask isn’t the one installed prints `Error: Cask 'claude-code@latest' is not installed.` To see which cask you have, run this in your terminal: + + brew list --cask | grep claude-code + +Upgrade the cask it prints. If it prints nothing, neither cask is installed. ### @@ -356,16 +450,19 @@ * PowerShell’s `Could not create SSL/TLS secure channel` * PowerShell’s `Could not establish trust relationship for the SSL/TLS secure channel` -**Solutions:** +For `CRYPT_E_NO_REVOCATION_CHECK` or `CRYPT_E_REVOCATION_OFFLINE`, go to step 4. **Solutions:** 1. **Update your system CA certificates** : On Ubuntu/Debian: sudo apt-get update && sudo apt-get install ca-certificates On macOS, the system curl uses the Keychain trust store; updating macOS itself updates the root certificates. - 2. **On Windows, enable TLS 1.2** in PowerShell before running the installer: + 2. **In Windows PowerShell 5.1, enable TLS 1.2** : [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + +Then run the installer in the same window: + irm https://claude.ai/install.ps1 | iex 3. **Check for proxy or firewall interference** : corporate proxies that perform TLS inspection can cause these errors, including `unable to get local issuer certificate` and `SELF_SIGNED_CERT_IN_CHAIN`. For the install step, make the install download trust your corporate proxy’s CA: @@ -408,6 +505,23 @@ `Failed to fetch version from downloads.claude.ai` The installer couldn’t reach the download server. This typically means `downloads.claude.ai` is blocked on your network. See Check network connectivity. + +### + +​ + +The connection dropped while downloading the update + +The connection to the download server closed while `claude install` or `claude update` was fetching the Claude Code binary, and the retries didn’t recover. Claude Code retries the download when the connection drops, the transfer stalls, or the downloaded file fails its checksum, up to three attempts in total. A completed HTTP error, such as a 404, isn’t retried because the server already answered. Before v2.1.202, a single dropped connection failed the download immediately with the bare error `aborted` instead of retrying. + + The connection dropped while downloading the update (attempt 3/3: aborted). Check your network — proxies sometimes cut off large downloads. + +The text in parentheses names which attempt failed and the underlying network error. `claude update` precedes the message with `Error: Failed to install native update` on stderr. A download that stays connected but doesn’t finish within 10 minutes fails with `Download timed out: exceeded the total deadline` instead. Claude Code doesn’t retry a timed-out download, because a connection too slow to finish inside the deadline won’t finish on an immediate retry either. The steps below apply to both messages. A proxy or gateway can close a long transfer before it finishes, and the Claude Code binary is a large download. **What to do:** + + * Run `claude update` again. On an otherwise healthy network, the download usually succeeds on the next run. For the timed-out message, run it again from a faster or less throttled network. + * If your network requires a proxy, set `HTTPS_PROXY` before running the installer or `claude update`. See Check network connectivity. + * If a corporate proxy keeps closing the transfer, ask your network team to allow the full download from `downloads.claude.ai`. See [Network access requirements](</docs/en/network-config#network-access-requirements>). + * Run `claude doctor` from your shell for installation diagnostics ### @@ -523,6 +637,22 @@ 2. **Close other processes** to free memory before installing. 3. **Use a larger instance** if possible. Claude Code requires at least 4 GB of RAM. + +### + +​ + +Installation was killed before it could finish + +The install script reports when the `claude install` step is terminated by a signal. On Linux, exit code 137 means the process received SIGKILL, and on a low-memory host that’s usually the kernel out-of-memory (OOM) killer. The script prints this explanation and exits with code 137: + + Installation was killed before it could finish (exit code 137). This usually means the system ran out of memory. + Claude Code needs roughly 512MB of free memory to install. Free up memory, then run this script again. + +For any other fatal signal, and for exit code 137 on macOS, the script prints `Installation was killed before it could finish (exit code <N>)` with the actual exit code and omits the out-of-memory explanation. The message comes from the install script macOS and Linux use, which also covers installs inside WSL; the native Windows install scripts never print it. Before v2.1.200, the script exited with only the shell’s bare `Killed` line. **What to do:** + + * Stop other processes to free memory, then rerun the installer + * Add swap space or move to a larger instance. See Install killed on low-memory Linux servers for the swap-file commands. ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -797,7 +797,7 @@ Reset your login -When login fails and the cause isn’t obvious, a clean re-authentication resolves most cases: +When login fails and the cause isn’t clear, a clean re-authentication resolves most cases: 1. Run `/logout` to sign out completely 2. Close Claude Code
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -320,7 +320,7 @@ Windows CMD| `'claude' is not recognized as an internal or external command` PowerShell| `claude : The term 'claude' is not recognized as the name of a cmdlet` -This means the install directory isn’t in your shell’s search path. See Verify your PATH for the fix on each platform. +On Windows, if the error started right after Claude Code updated, see restore `claude.exe` from its backup. Otherwise, see Verify your PATH for the fix on each platform. ### @@ -485,7 +485,7 @@ `claude.exe` missing after an update on Windows -If your terminal reports `'claude' is not recognized` right after Claude Code updated on Windows, check whether `%USERPROFILE%\.local\bin` still contains `claude.exe`. If that directory isn’t on your PATH at all, see Fix your PATH instead. To update on Windows, Claude Code renames the existing `claude.exe` aside to a backup and moves the new version into its place. If moving the new version into place fails and Claude Code can’t rename the backup back either, the directory keeps the backup but has no `claude.exe`. The backup is a file in the same directory whose name begins with `claude.exe.old.` followed by a numeric timestamp. Run the following in PowerShell to rename the newest backup back to `claude.exe`: +If your terminal reports `'claude' is not recognized` right after Claude Code updated on Windows, check whether `%USERPROFILE%\.local\bin` still contains `claude.exe`. If that directory isn’t on your PATH at all, see Verify your PATH instead. To update on Windows, Claude Code renames the existing `claude.exe` aside to a backup and moves the new version into its place. If moving the new version into place fails and Claude Code can’t rename the backup back either, the directory keeps the backup but has no `claude.exe`. The backup is a file in the same directory whose name begins with `claude.exe.old.` followed by a numeric timestamp. Run the following in PowerShell to rename the newest backup back to `claude.exe`: Get-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.exe
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -16,6 +16,7 @@ `curl: (23)` or `curl: (56) Failure writing output to destination`| Check connectivity or use an alternative installer `Killed` during install on Linux, or `Installation was killed before it could finish (exit code 137)`| Free memory or add swap space `Raw mode is not supported` during install| Rerun the installer +`EACCES: permission denied` during install| Fix the install directory’s permissions `TLS connect error` or `SSL/TLS secure channel`| Update CA certificates `Failed to fetch version` or can’t reach download server| Check network and proxy settings `irm is not recognized` or `The token '&&' is not a valid statement separator`| Use the right command for your shell @@ -28,6 +29,7 @@ `Error loading shared library`| Wrong binary variant for your system `Illegal instruction`| Architecture or CPU instruction set mismatch `cannot execute binary file: Exec format error` in WSL| WSL1 native-binary regression +`Bus error` or `oh no: Bun has crashed` while a session is running| Keep the executable readable PowerShell installer completes but `claude` is not found or shows an old version| Add the install directory to your PATH, then open a new terminal `dyld: Symbol not found`, `dyld: cannot load`, or `Abort trap` on macOS| Binary incompatibility `claude update` hangs after `Checking for updates`, or `claude doctor` hangs with no output| Move the directory at a shell config path @@ -217,7 +219,16 @@ Check directory permissions -The installer needs write access to `~/.local/bin/` and `~/.claude/` on macOS and Linux. On Windows the install location is under `%USERPROFILE%`, which is writable by your user by default, so this section rarely applies there. Check whether the directories are writable: +An install that fails on permissions names the path it couldn’t create or write. On Windows the install writes under `%USERPROFILE%`, which is writable by your user by default, so this section rarely applies there. On macOS and Linux the install writes to these locations: + + * `~/.claude/downloads/`: where the install command puts the downloaded binary + * `~/.local/bin/`: the `claude` launcher + * `~/.local/share/claude/`: each version it downloads + * `~/.local/state/claude/`: its lock files + * `~/.cache/claude/`: staged downloads + * [`~/.claude.json`](</docs/en/claude-directory>): your global config file, where the installer records the install method + +If you set `XDG_DATA_HOME`, `XDG_STATE_HOME`, or `XDG_CACHE_HOME`, the install uses those in place of `~/.local/share`, `~/.local/state`, and `~/.cache`. If you set [`CLAUDE_CONFIG_DIR`](</docs/en/env-vars>), the global config file lives under that directory instead of your home directory. Check whether the directories are writable: test -w ~/.local/bin && echo "writable" || echo "not writable" test -w ~/.claude && echo "writable" || echo "not writable" @@ -657,6 +668,14 @@ ​ +`Bus error` while a session is running + +If a running session exits and your shell prints `Bus error`, one cause is that Claude Code could no longer read its own executable file from disk. For example, the file was truncated, or deleted on network storage, while the session ran. Before the shell’s message, Claude Code’s runtime can print a crash report that includes `panic(main thread): Bus error at address` and `oh no: Bun has crashed. This indicates a bug in Bun, not your code.` When the executable became unreadable, the crash comes from the unreadable file, not from a bug in Bun. The report can also be missing, if the runtime couldn’t read the code that prints it either. Start a new session to continue. If Claude Code is installed on network storage, follow [Install on network storage](</docs/en/setup#install-on-network-storage>) so upgrades don’t remove a binary that running sessions still need. + +### + +​ + `Exec format error` on WSL1 If running `claude` in WSL prints `cannot execute binary file: Exec format error`, you’re on WSL1 and hitting a known native-binary regression tracked in [issue #38788](<https://github.com/anthropics/claude-code/issues/38788>). The binary’s program headers changed in a way WSL1’s loader can’t handle. The cleanest fix is to convert your distribution to WSL2 from PowerShell: @@ -864,7 +883,7 @@ Not logged in or token expired -If Claude Code prompts you to log in again after a session, your OAuth token may have expired. Run `/login` to re-authenticate. If this happens frequently, check that your system clock is accurate, as token validation depends on correct timestamps. Parallel sessions on one machine share a saved login and coordinate its renewal so that only one process refreshes the token at a time. Before v2.1.211, waking the machine from sleep could cause two sessions to renew with the same token, which revoked the saved login and prompted every open session to log in again at once. On macOS, Claude Code saves credentials to the login Keychain. When the Keychain rejects the write, such as when it’s locked in an SSH session or its password is out of sync with your account password, Claude Code saves your login to the plaintext `~/.claude/.credentials.json` file instead. A Console login that creates an API key fails until the Keychain is writable again. To make the Keychain writable again and move your login back into the encrypted Keychain: +If Claude Code prompts you to log in again after a session, your OAuth token may have expired. Run `/login` to re-authenticate. If this happens frequently, check that your system clock is accurate, as token validation depends on correct timestamps. Parallel sessions on one machine share a saved login and coordinate its renewal so that only one process refreshes the token at a time. For what the other sessions do after you sign in again in one of them, see [Not logged in](</docs/en/errors#not-logged-in>). Before v2.1.211, waking the machine from sleep could cause two sessions to renew with the same token, which revoked the saved login and prompted every open session to log in again at once. On macOS, Claude Code saves credentials to the login Keychain. When the Keychain rejects the write, such as when it’s locked in an SSH session or its password is out of sync with your account password, Claude Code saves your login to the plaintext `~/.claude/.credentials.json` file instead. A Console login that creates an API key fails until the Keychain is writable again. To make the Keychain writable again and move your login back into the encrypted Keychain: 1
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -338,7 +338,14 @@ TLS or SSL connection errors -Errors like `curl: (35) TLS connect error`, `schannel: next InitializeSecurityContext failed`, or PowerShell’s `Could not establish trust relationship for the SSL/TLS secure channel` indicate TLS handshake failures. **Solutions:** +Errors such as these mean the TLS handshake failed: + + * `curl: (35) TLS connect error` + * `schannel: next InitializeSecurityContext failed` + * PowerShell’s `Could not create SSL/TLS secure channel` + * PowerShell’s `Could not establish trust relationship for the SSL/TLS secure channel` + +**Solutions:** 1. **Update your system CA certificates** : On Ubuntu/Debian: @@ -797,7 +804,7 @@ 403 Forbidden after login -If you see `API Error: 403 {"error":{"type":"forbidden","message":"Request not allowed"}}` after logging in: +If you see `API Error: 403 Request not allowed` after logging in: * **Claude Pro/Max users** : verify your subscription is active at [claude.ai/settings](<https://claude.ai/settings>) * **Anthropic Console users** : confirm your account has the “Claude Code” or “Developer” role. Admins assign this in the Anthropic Console under Settings → Members.
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -35,10 +35,12 @@ `running scripts is disabled on this system` or `PSSecurityException`| Allow the npm shims to run `Error: claude native binary not installed`| Complete the npm install `npm error code ENOTEMPTY` during update or reinstall| Remove the leftover package directory +`'claude' is not recognized` right after an update on Windows| Restore `claude.exe` from its backup On Windows, the install command prints script text and nothing installs| Run the complete install command `App unavailable in region`| Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). `unable to get local issuer certificate`| Configure corporate CA certificates `OAuth error` or `403 Forbidden`| Fix authentication +`Claude Code access has not been granted for this account`| Get a role that includes Claude Code `Unable to connect to Anthropic services` during setup| See [Unable to connect to Anthropic services](</docs/en/errors#unable-to-connect-to-anthropic-services>) in the Error reference `Could not load the default credentials` or `Could not load credentials from any providers`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials `ChainedTokenCredential authentication failed` or `CredentialUnavailableError`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials @@ -122,10 +124,15 @@ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc source ~/.zshrc -For Bash, the default on most Linux distributions: +For Bash on Linux, where it’s the default on most distributions: echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc source ~/.bashrc + +For Bash on macOS, add the line to `~/.bash_profile` instead. Terminal on macOS starts Bash as a login shell, which ignores `~/.bashrc` and reads only the first of `~/.bash_profile`, `~/.bash_login`, or `~/.profile` that exists. If you already have a `~/.bash_login` or `~/.profile` and no `~/.bash_profile`, put the line in that file rather than creating `~/.bash_profile`: + + echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bash_profile + source ~/.bash_profile Alternatively, close and reopen your terminal.For other shells such as fish or Nushell, add `~/.local/bin` to your PATH using your shell’s own configuration syntax, then restart your terminal.Verify the fix worked: @@ -458,6 +465,22 @@ ​ +`claude.exe` missing after an update on Windows + +If your terminal reports `'claude' is not recognized` right after Claude Code updated on Windows, check whether `%USERPROFILE%\.local\bin` still contains `claude.exe`. If that directory isn’t on your PATH at all, see Fix your PATH instead. To update on Windows, Claude Code renames the existing `claude.exe` aside to a backup and moves the new version into its place. If moving the new version into place fails and Claude Code can’t rename the backup back either, the directory keeps the backup but has no `claude.exe`. The backup is a file in the same directory whose name begins with `claude.exe.old.` followed by a numeric timestamp. Run the following in PowerShell to rename the newest backup back to `claude.exe`: + + Get-ChildItem "$env:USERPROFILE\.local\bin\claude.exe.old.*" | Sort-Object Name | Select-Object -Last 1 | Rename-Item -NewName claude.exe + +Then run `claude --version` to confirm the fix. A restored `claude.exe` prints a version number. If there’s no `claude.exe.old.*` file, or `claude` still fails after the rename, reinstall instead: + + irm https://claude.ai/install.ps1 | iex + +Before v2.1.281, Claude Code could delete the backup while `claude.exe` was still missing. + +### + +​ + Install killed on low-memory Linux servers A `Killed` message during install usually means the Linux out-of-memory (OOM) killer terminated the `claude install` step because the system ran out of free memory. This is common on small VPS and cloud instances. The install script reports the cause and exits with code 137. In this example, the line number and process ID vary by release and run: @@ -784,6 +807,17 @@ ​ +Claude Code access has not been granted for this account + +If the sign-in page shows `Authorization failed` with the message `Claude Code access has not been granted for this account. Contact your administrator.` after you log in from Claude Code, your Claude Enterprise organization has set your role to Custom and none of the [custom roles](<https://support.claude.com/en/articles/13930452>) assigned to your groups grants Claude Code. On the Custom role, you get access only from those custom roles, so nothing you change in Claude Code resolves this error. To get access: + + 1. Ask an Owner of your Claude organization to assign a custom role that grants Claude Code access to one of your groups, or to change your role from Custom to a standard role such as User. Owners manage roles in the organization’s [role settings](<https://claude.ai/admin-settings/roles>). + 2. After the Owner makes the change, run `claude` and log in again. + +### + +​ + This organization has been disabled with an active subscription If you see `API Error: 400 ... "This organization has been disabled"` despite having an active Claude subscription, an `ANTHROPIC_API_KEY` environment variable is overriding your subscription. This commonly happens when an old API key from a previous employer or project is still set in your shell profile. When `ANTHROPIC_API_KEY` is present and you have approved it, Claude Code uses that key instead of your subscription’s OAuth credentials. In non-interactive mode with the `-p` flag, the key is always used when present. See [authentication precedence](</docs/en/authentication#authentication-precedence>) for the full resolution order. To use your subscription instead, unset the environment variable and remove it from your shell profile:
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -18,7 +18,7 @@ `Raw mode is not supported` during install| Rerun the installer `TLS connect error` or `SSL/TLS secure channel`| Update CA certificates `Failed to fetch version` or can’t reach download server| Check network and proxy settings -`irm is not recognized` or `&& is not valid`| Use the right command for your shell +`irm is not recognized` or `The token '&&' is not a valid statement separator`| Use the right command for your shell `Cask 'claude-code' is unavailable: No Cask with this name exists`| Update Homebrew `'bash' is not recognized as the name of a cmdlet`| Use the Windows installer command `A parameter cannot be found that matches parameter name 'fsSL'`| Use the Windows installer command @@ -390,7 +390,7 @@ Wrong install command on Windows -If you see `'irm' is not recognized`, `The token '&&' is not valid`, `A parameter cannot be found that matches parameter name 'fsSL'`, or `'bash' is not recognized as the name of a cmdlet`, you copied the install command for a different shell or operating system. If the command prints the script’s text instead of installing anything, you ran only part of it. +If you see `'irm' is not recognized`, `The token '&&' is not a valid statement separator`, `A parameter cannot be found that matches parameter name 'fsSL'`, or `'bash' is not recognized as the name of a cmdlet`, you copied the install command for a different shell or operating system. If the command prints the script’s text instead of installing anything, you ran only part of it. * **`irm` not recognized**: you’re in CMD, not PowerShell. You have two options: Open PowerShell by searching for “PowerShell” in the Start menu, then run the original install command: @@ -400,7 +400,7 @@ curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd - * **`&&` not valid**: you’re in PowerShell but ran the CMD installer command. Use the PowerShell installer: + * **`&&` not a valid statement separator**: you’re in PowerShell but ran the CMD installer command. Use the PowerShell installer: irm https://claude.ai/install.ps1 | iex
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -722,7 +722,7 @@ rm -rf "$(npm root -g)/@anthropic-ai/claude-code" -Then remove any leftover temp directories. If zsh prints `no matches found`, there were none to remove: +Then remove any leftover temp directories. If Zsh prints `no matches found`, there were none to remove: rm -rf "$(npm root -g)/@anthropic-ai/.claude-code-"*
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -310,25 +310,7 @@ `curl: (56) Failure writing output to destination` -The `curl ... | bash` command downloads the script and pipes it to Bash for execution. This error, and the related `curl: (23) Failure writing output to destination`, means Bash did not receive the complete script. Exit code 56 indicates the download itself was interrupted, and exit code 23 indicates curl could not write what it received to the pipe, usually because Bash exited early. **Solutions:** - - 1. **Check network stability** : Claude Code binaries are hosted at `downloads.claude.ai`. Test that you can reach it: - - curl -sI https://downloads.claude.ai/claude-code-releases/latest - -An `HTTP/2 200` line means you reached the server and the original failure was likely intermittent; retry the install command. Other results point to the cause: - * `403`: usually a proxy or network filter blocking the host, or Claude Code is [not available in your region](<https://www.anthropic.com/supported-countries>) - * `5xx`: usually a temporary service issue; wait a few minutes and retry - * `Could not resolve host` or a connection timeout: your network is blocking the download - 2. **Try an alternative install method** : On macOS: - - brew install --cask claude-code - -On Windows: - - winget install Anthropic.ClaudeCode - -Then run `claude --version` to confirm: the command prints a version number such as `2.1.211 (Claude Code)`. If the shell reports `claude` isn’t found, open a new terminal window and retry: the session you installed from keeps its old `PATH`. +The `curl ... | bash` command downloads the script and pipes it to Bash for execution. This error, and the related `curl: (23) Failure writing output to destination`, means Bash did not receive the complete script. Exit code 56 indicates the download itself was interrupted, and exit code 23 indicates curl could not write what it received to the pipe, usually because Bash exited early. Test that you can reach `downloads.claude.ai` with the check in Check network connectivity. If you reached the server, the original failure was likely intermittent; retry the install command. You can also [try an alternative install method](</docs/en/setup#install-claude-code>). ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -841,7 +841,33 @@ Not logged in or token expired -If Claude Code prompts you to log in again after a session, your OAuth token may have expired. Run `/login` to re-authenticate. If this happens frequently, check that your system clock is accurate, as token validation depends on correct timestamps. Parallel sessions on one machine share a saved login and coordinate its renewal so that only one process refreshes the token at a time. Before v2.1.211, waking the machine from sleep could cause two sessions to renew with the same token, which revoked the saved login and prompted every open session to log in again at once. On macOS, login can also fail when the Keychain is locked or its password is out of sync with your account password, which prevents Claude Code from saving credentials. Run `claude doctor` to check Keychain access. To unlock the Keychain manually, run `security unlock-keychain ~/Library/Keychains/login.keychain-db`. If unlocking doesn’t help, open Keychain Access, select the `login` keychain, and choose Edit > Change Password for Keychain “login” to resync it with your account password. +If Claude Code prompts you to log in again after a session, your OAuth token may have expired. Run `/login` to re-authenticate. If this happens frequently, check that your system clock is accurate, as token validation depends on correct timestamps. Parallel sessions on one machine share a saved login and coordinate its renewal so that only one process refreshes the token at a time. Before v2.1.211, waking the machine from sleep could cause two sessions to renew with the same token, which revoked the saved login and prompted every open session to log in again at once. On macOS, Claude Code saves credentials to the login Keychain. When the Keychain rejects the write, such as when it’s locked in an SSH session or its password is out of sync with your account password, Claude Code saves your login to the plaintext `~/.claude/.credentials.json` file instead. A Console login that creates an API key fails until the Keychain is writable again. To make the Keychain writable again and move your login back into the encrypted Keychain: + +1 + +Check Keychain access + +Run `claude doctor` to check Keychain access. When the Keychain rejects writes, the report lists a warning that starts with `macOS Keychain is not writable`, followed by a suggested fix. When the report lists no Keychain warning, the Keychain is writable and you can skip to the last step. + +2 + +Unlock the Keychain + + security unlock-keychain ~/Library/Keychains/login.keychain-db + +Enter your Keychain password when the command asks for it, then run `claude doctor` again. When the unlock worked, the report no longer lists the Keychain warning. + +3 + +Resync the Keychain password if unlocking doesn't help + +Open Keychain Access, select the `login` keychain, and choose **Edit > Change Password for Keychain “login”** to resync it with your account password. Then run `claude doctor` again. Go on to the next step once the report no longer lists the Keychain warning. + +4 + +Log out and back in + +Once the Keychain is writable again, Claude Code moves the credentials back the next time it writes a credential. To force it now, run `/logout` and then `/login`. Logging out removes all stored credentials, including the plaintext file’s contents, saved MCP server logins, and plugin sensitive values, so expect to re-authorize MCP servers and re-enter plugin secrets afterwards. Logging in again stores your login in the Keychain. ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -15,6 +15,7 @@ `curl: (22) The requested URL returned error: 403`| Install script returned 403 `curl: (23)` or `curl: (56) Failure writing output to destination`| Check connectivity or use an alternative installer `Killed` during install on Linux, or `Installation was killed before it could finish (exit code 137)`| Free memory or add swap space +`Raw mode is not supported` during install| Rerun the installer `TLS connect error` or `SSL/TLS secure channel`| Update CA certificates `Failed to fetch version` or can’t reach download server| Check network and proxy settings `irm is not recognized` or `&& is not valid`| Use the right command for your shell @@ -519,6 +520,24 @@ ​ +`Raw mode is not supported` during install + +When your organization’s [server-managed settings](</docs/en/server-managed-settings>) include changes that need [security approval](</docs/en/server-managed-settings#security-approval-dialogs>), Claude Code versions before 2.1.246 try to show the approval dialog during `claude install`. The dialog needs a terminal on stdin. When the installer runs `claude install` from a pipe, as `curl -fsSL https://claude.ai/install.sh | bash` does, stdin is the pipe rather than a terminal, so the install fails with an error containing `Raw mode is not supported`. Claude Code v2.1.246 and later don’t show the dialog during `claude install` or `claude update`. The command runs with the settings you last approved, and Claude Code shows the dialog in your next interactive session. If your organization’s startup configuration [waits for the settings fetch](</docs/en/server-managed-settings#enforce-fail-closed-startup>), such as when it sets `forceRemoteSettingsRefresh`, the dialog still appears during these commands, and an install run from a pipe still fails. In every other configuration, rerunning the installer gets past this error, because the script runs the latest release’s `install` command even when you ask it to install an older version. Rerun the command for your platform: + + * macOS/Linux + + * Windows PowerShell + + curl -fsSL https://claude.ai/install.sh | bash + + irm https://claude.ai/install.ps1 | iex + +`claude --version` prints the version the rerun installed. + +### + +​ + `claude update` or `claude doctor` hangs `claude update` and `claude doctor` scan your shell configuration files for an outdated `claude` alias: `~/.zshrc`, `~/.bashrc`, and `~/.config/fish/config.fish`, plus on macOS the first of `~/.bash_profile`, `~/.bash_login`, or `~/.profile` that exists. If you set `ZDOTDIR`, the Zsh file is `$ZDOTDIR/.zshrc` instead. When one of those paths is a directory, Claude Code skips it and both commands complete normally. Before v2.1.214, a directory at one of those paths made both commands hang and left the System diagnostics section of `/status` blank. `claude doctor` hung with no output; `claude update` hung right after printing `Checking for updates`. If you hit the hang on an earlier version, find the directory. In this command’s output, a line starting with `d` marks that path as a directory. A `No such file or directory` line means nothing exists at that path and isn’t the cause:
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -399,29 +399,7 @@ `Failed to fetch version from downloads.claude.ai` -The installer couldn’t reach the download server. This typically means `downloads.claude.ai` is blocked on your network. **Solutions:** - - 1. **Test connectivity directly** : - - curl -sI https://downloads.claude.ai/claude-code-releases/latest - -An `HTTP/2 200` line means the server is reachable. Other results point to the cause: - * `403`: usually a proxy or network filter blocking the host, or Claude Code is [not available in your region](<https://www.anthropic.com/supported-countries>) - * `5xx`: usually a temporary service issue; wait a few minutes and retry - 2. **If behind a proxy** , set `HTTPS_PROXY` so the installer can route through it. See [proxy configuration](</docs/en/network-config#proxy-configuration>) for details. - - export HTTPS_PROXY=http://proxy.example.com:8080 - curl -fsSL https://claude.ai/install.sh | bash - - 3. **If on a restricted network** , try a different network or VPN, or use an alternative install method: On macOS: - - brew install --cask claude-code - -On Windows: - - winget install Anthropic.ClaudeCode - -Then run `claude --version` to confirm: the command prints a version number such as `2.1.211 (Claude Code)`. If the shell reports `claude` isn’t found, open a new terminal window and retry: the session you installed from keeps its old `PATH`. +The installer couldn’t reach the download server. This typically means `downloads.claude.ai` is blocked on your network. See Check network connectivity. ### @@ -506,7 +484,7 @@ Installation was killed before it could finish (exit code 137). This usually means the system ran out of memory. Claude Code needs roughly 512MB of free memory to install. Free up memory, then run this script again. -Before v2.1.200, the script exited with only the shell’s bare `Killed` line and no explanation. Installing needs roughly 512 MB of free memory, and running Claude Code needs more. See the [system requirements](</docs/en/setup#system-requirements>). **Solutions:** +Installing needs roughly 512 MB of free memory, and running Claude Code needs more. See the [system requirements](</docs/en/setup#system-requirements>). **Solutions:** 1. **Add swap space** if your server has limited RAM. Swap uses disk space as overflow memory, letting the install complete even with low physical RAM. Create a 2 GB swap file and enable it:
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -563,7 +563,12 @@ Claude Code on Windows requires either Git for Windows (for bash) or PowerShell -Git for Windows is optional. Claude Code uses the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) when Git Bash is absent, so this error means neither shell was found. **If PowerShell is missing from your PATH** , its default location is `C:\Windows\System32\WindowsPowerShell\v1.0\`. Add that directory to your `PATH`, or install [PowerShell 7](<https://aka.ms/powershell>), which provides `pwsh`. **To install Git for Windows instead** , download it from [git-scm.com/downloads/win](<https://git-scm.com/downloads/win>). During setup, select “Add to PATH.” Restart your terminal after installing. Installing it enables the Bash tool, useful when working with Bash-based scripts and tooling. **If Git is already installed** but Claude Code can’t find it, set the path in your [settings.json file](</docs/en/settings>): +Git for Windows is optional. Claude Code uses the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) when Git Bash is absent, so this error means neither shell was found. **If PowerShell is missing from your PATH** , its default location is `C:\Windows\System32\WindowsPowerShell\v1.0\`. Add that directory to your `PATH`, or install [PowerShell 7](<https://aka.ms/powershell>), which provides `pwsh`. **To install Git for Windows instead** , download it from [git-scm.com/downloads/win](<https://git-scm.com/downloads/win>). During setup, select “Add to PATH.” Restart your terminal after installing. Installing it enables the Bash tool, useful when working with Bash-based scripts and tooling. **If Git is already installed** but Claude Code can’t find it, compare its location against the places Claude Code checks. When `CLAUDE_CODE_GIT_BASH_PATH` isn’t set, Claude Code looks for `bash.exe` in this order: + + 1. The default install locations `C:\Program Files\Git` and `C:\Program Files (x86)\Git`. + 2. The `git` on your `PATH`, using the `bin\bash.exe` from that Git installation. + +In step 2, Claude Code skips a `git` that sits in the folder you launched Claude Code from, or below it in a path that contains `node_modules` or a virtual-environment folder such as `.venv` or `env`, for example `C:\dev\env\myproject\Git` when you launched from `C:\dev\env\myproject`. This keeps Claude Code from running an executable that a project placed there. If your Git is in a location like that, point `CLAUDE_CODE_GIT_BASH_PATH` at it. **To point Claude Code at a specific Git installation** , find it by running `where.exe git` in PowerShell, then set the `bin\bash.exe` path from that installation as `CLAUDE_CODE_GIT_BASH_PATH` in your [settings.json file](</docs/en/settings>): { "env": { @@ -571,7 +576,7 @@ } } -If your Git is installed somewhere else, find the path by running `where.exe git` in PowerShell and use the `bin\bash.exe` path from that directory. **If the path is correct and the file exists** but Claude Code still doesn’t use it, check the file’s name first. Claude Code accepts only a file named `bash.exe`, `sh.exe`, `bash`, or `sh`; with any other name, such as Git for Windows’ `git-bash.exe` launcher, it ignores the variable and auto-detects Git Bash as if it were unset, logging a warning visible with `--debug`. A path that doesn’t exist gets the same fallback and warning. Before v2.1.219, Claude Code used any existing file as the shell without checking its name, and exited at startup with `Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path` when the path didn’t exist. If the file’s name is right, endpoint security software such as AppLocker, Group Policy software restriction policies, or EDR agents may be interfering. Ask your IT team to allowlist `claude.exe` and the processes it spawns, including `cmd.exe` and `bash.exe`, in your endpoint protection policy. +**If`CLAUDE_CODE_GIT_BASH_PATH` is set to the correct path and the file exists** but Claude Code still doesn’t use it, check the file’s name first. Claude Code accepts only a file named `bash.exe`, `sh.exe`, `bash`, or `sh`; with any other name, such as Git for Windows’ `git-bash.exe` launcher, it ignores the variable and auto-detects Git Bash as if it were unset, logging a warning visible with `--debug`. A path that doesn’t exist gets the same fallback and warning. Before v2.1.219, Claude Code used any existing file as the shell without checking its name, and exited at startup with `Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path` when the path didn’t exist. If the file’s name is right, endpoint security software such as AppLocker, Group Policy software restriction policies, or EDR agents may be interfering. Ask your IT team to allowlist `claude.exe` and the processes it spawns, including `cmd.exe` and `bash.exe`, in your endpoint protection policy. ###
modified
Show diff (108 lines)
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -28,11 +28,13 @@ `Illegal instruction`| Architecture or CPU instruction set mismatch `cannot execute binary file: Exec format error` in WSL| WSL1 native-binary regression PowerShell installer completes but `claude` is not found or shows an old version| Add the install directory to your PATH, then open a new terminal -`dyld: cannot load`, `dyld: Symbol not found`, or `Abort trap` on macOS| Binary incompatibility +`dyld: Symbol not found`, `dyld: cannot load`, or `Abort trap` on macOS| Binary incompatibility `claude update` hangs after `Checking for updates`, or `claude doctor` hangs with no output| Move the directory at a shell config path `Invoke-Expression` or `iex` parse errors quoting HTML tags or CSS, or `ParserError` with `ParseException`| Install script returns HTML `running scripts is disabled on this system` or `PSSecurityException`| Allow the npm shims to run `Error: claude native binary not installed`| Complete the npm install +`npm error code ENOTEMPTY` during update or reinstall| Remove the leftover package directory +On Windows, the install command prints script text and nothing installs| Run the complete install command `App unavailable in region`| Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). `unable to get local issuer certificate`| Configure corporate CA certificates `OAuth error` or `403 Forbidden`| Fix authentication @@ -427,7 +429,7 @@ Wrong install command on Windows -If you see `'irm' is not recognized`, `The token '&&' is not valid`, `A parameter cannot be found that matches parameter name 'fsSL'`, or `'bash' is not recognized as the name of a cmdlet`, you copied the install command for a different shell or operating system. +If you see `'irm' is not recognized`, `The token '&&' is not valid`, `A parameter cannot be found that matches parameter name 'fsSL'`, or `'bash' is not recognized as the name of a cmdlet`, you copied the install command for a different shell or operating system. If the command prints the script’s text instead of installing anything, you ran only part of it. * **`irm` not recognized**: you’re in CMD, not PowerShell. You have two options: Open PowerShell by searching for “PowerShell” in the Start menu, then run the original install command: @@ -448,6 +450,16 @@ * **`bash` not recognized**: you ran the macOS/Linux installer on Windows. Use the PowerShell installer instead: irm https://claude.ai/install.ps1 | iex + + * **The command prints script text instead of installing** : you ran the download half of the command without the part that executes it. `irm https://claude.ai/install.ps1` on its own prints the downloaded script to the terminal. Pipe it to `iex` to run it: + + irm https://claude.ai/install.ps1 | iex + +In CMD, `curl -fsSL https://claude.ai/install.cmd` without `-o` prints the batch script instead of saving it. Run the complete command: + + curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd + +Whichever installer you use, confirm it worked: open a new terminal and run `claude --version`, which prints a version number such as `2.1.211 (Claude Code)`. ### @@ -611,16 +623,16 @@ `dyld: cannot load` on macOS -If you see `dyld: cannot load`, `dyld: Symbol not found`, or `Abort trap: 6` during installation, the binary is incompatible with your macOS version or hardware. - - dyld: cannot load 'claude-2.1.42-darwin-x64' (load command 0x80000034 is unknown) - Abort trap: 6 - -A `Symbol not found` error that references `libicucore` also indicates your macOS version is older than the binary supports: +If you see `dyld: Symbol not found`, `dyld: cannot load`, or `Abort trap: 6` during installation, the binary is incompatible with your macOS version or hardware. A `Symbol not found` error that references `libicucore` means your macOS version is older than the binary supports: dyld: Symbol not found: _ubrk_clone Referenced from: claude-darwin-x64 (which was built for Mac OS X 13.0) Expected in: /usr/lib/libicucore.A.dylib + +The loader can instead reject the binary’s load commands, which also means your macOS version is too old: + + dyld: cannot load 'claude-2.1.42-darwin-x64' (load command 0x80000034 is unknown) + Abort trap: 6 **Solutions:** @@ -703,6 +715,41 @@ * **Unsupported platform.** Prebuilt binaries are published for `darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `linux-x64-musl`, `linux-arm64-musl`, `win32-x64`, and `win32-arm64`. Claude Code does not ship a binary for other platforms; see the [system requirements](</docs/en/setup#system-requirements>). On FreeBSD, the installer reports the platform as unsupported. Before v2.1.205, it treated FreeBSD as Linux and downloaded a binary that couldn’t run. * **Corporate npm mirror is missing the platform packages.** Ensure your registry mirrors all eight `@anthropic-ai/claude-code-*` platform packages in addition to the meta package. +### + +​ + +npm `ENOTEMPTY` error during update or reinstall + +When you run `npm install -g @anthropic-ai/claude-code` over an existing installation, npm can fail while moving the old package directory aside: + + npm error code ENOTEMPTY + npm error syscall rename + npm error path /home/you/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/claude-code + npm error dest /home/you/.nvm/versions/node/v22.13.1/lib/node_modules/@anthropic-ai/.claude-code-tVWAnUUt + npm error errno -39 + npm error ENOTEMPTY: directory not empty, rename '...' + +The `npm error path` line names the directory npm couldn’t move. Delete that directory and any leftover `.claude-code-*` directories next to it, which earlier interrupted runs can leave behind. The commands below find your global package directory with `npm root -g`; if the directory the `npm error path` line names is not under the directory `npm root -g` prints, for example because you switched Node versions with nvm, delete the directories the error names instead: + + * macOS/Linux + + * Windows PowerShell + + rm -rf "$(npm root -g)/@anthropic-ai/claude-code" + +Then remove any leftover temp directories. If zsh prints `no matches found`, there were none to remove: + + rm -rf "$(npm root -g)/@anthropic-ai/.claude-code-"* + + Remove-Item -Recurse -Force "$(npm root -g)/@anthropic-ai/claude-code", "$(npm root -g)/@anthropic-ai/.claude-code-*" + +Then reinstall: + + npm install -g @anthropic-ai/claude-code + +Confirm with `claude --version`, which prints a version number such as `2.1.211 (Claude Code)`. + ## ​
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -185,9 +185,11 @@ Remove the legacy local npm install: + * macOS/Linux + + * Windows PowerShell + rm -rf ~/.claude/local - -On Windows, use PowerShell: Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\local" @@ -223,9 +225,11 @@ If `claude --version` prints a version but `claude` crashes or hangs on startup, run these checks to narrow down the cause. If `claude --version` says command not found, go to Verify your PATH first; the commands below assume `claude` is on your PATH. Confirm the binary exists and is executable: + * macOS/Linux + + * Windows PowerShell + ls -la "$(command -v claude)" - -On Windows, use PowerShell: Get-Command claude | Select-Object Source @@ -555,7 +559,7 @@ } } -If your Git is installed somewhere else, find the path by running `where.exe git` in PowerShell and use the `bin\bash.exe` path from that directory. **If the path is correct and the file exists** but Claude Code still doesn’t use it, check the file’s name first. Claude Code accepts only a file named `bash.exe`, `sh.exe`, `bash`, or `sh`; with any other name, such as Git for Windows’ `git-bash.exe` launcher, it ignores the variable and auto-detects Git Bash as if it were unset, logging a warning visible with `--debug`. A path that doesn’t exist gets the same fallback and warning. Before v2.1.219, Claude Code used any existing file as the shell without checking its name, and exited at startup with `Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path` when the path didn’t exist. If the file’s name is right, endpoint security software such as AppLocker, Group Policy software restriction policies, or EDR agents may be interfering. On versions before v2.1.116, Claude Code spawned a `cmd.exe` child process to verify the path, which these policies can block. A common signal is that `cmd.exe /c dir "C:\Program Files\Git\bin\bash.exe"` works when you run it directly in PowerShell but fails silently when launched by `claude.exe`. Claude Code v2.1.116 and later check the filesystem directly, so update first. If the error persists on a current version, ask your IT team to allowlist `claude.exe` and the processes it spawns, including `cmd.exe` and `bash.exe`, in your endpoint protection policy. +If your Git is installed somewhere else, find the path by running `where.exe git` in PowerShell and use the `bin\bash.exe` path from that directory. **If the path is correct and the file exists** but Claude Code still doesn’t use it, check the file’s name first. Claude Code accepts only a file named `bash.exe`, `sh.exe`, `bash`, or `sh`; with any other name, such as Git for Windows’ `git-bash.exe` launcher, it ignores the variable and auto-detects Git Bash as if it were unset, logging a warning visible with `--debug`. A path that doesn’t exist gets the same fallback and warning. Before v2.1.219, Claude Code used any existing file as the shell without checking its name, and exited at startup with `Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path` when the path didn’t exist. If the file’s name is right, endpoint security software such as AppLocker, Group Policy software restriction policies, or EDR agents may be interfering. Ask your IT team to allowlist `claude.exe` and the processes it spawns, including `cmd.exe` and `bash.exe`, in your endpoint protection policy. ### @@ -699,8 +703,6 @@ * **Unsupported platform.** Prebuilt binaries are published for `darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `linux-x64-musl`, `linux-arm64-musl`, `win32-x64`, and `win32-arm64`. Claude Code does not ship a binary for other platforms; see the [system requirements](</docs/en/setup#system-requirements>). On FreeBSD, the installer reports the platform as unsupported. Before v2.1.205, it treated FreeBSD as Linux and downloaded a binary that couldn’t run. * **Corporate npm mirror is missing the platform packages.** Ensure your registry mirrors all eight `@anthropic-ai/claude-code-*` platform packages in addition to the meta package. -Before v2.1.113, the npm package shipped Claude Code as JavaScript that ran directly in Node rather than as a native binary, so there was no download or postinstall step to skip and this error didn’t exist. - ## ​ @@ -755,7 +757,14 @@ If you see `API Error: 400 ... "This organization has been disabled"` despite having an active Claude subscription, an `ANTHROPIC_API_KEY` environment variable is overriding your subscription. This commonly happens when an old API key from a previous employer or project is still set in your shell profile. When `ANTHROPIC_API_KEY` is present and you have approved it, Claude Code uses that key instead of your subscription’s OAuth credentials. In non-interactive mode with the `-p` flag, the key is always used when present. See [authentication precedence](</docs/en/authentication#authentication-precedence>) for the full resolution order. To use your subscription instead, unset the environment variable and remove it from your shell profile: + * macOS/Linux + + * Windows PowerShell + unset ANTHROPIC_API_KEY + claude + + Remove-Item Env:ANTHROPIC_API_KEY claude Check `~/.zshrc`, `~/.bashrc`, or `~/.profile` for `export ANTHROPIC_API_KEY=...` lines and remove them to make the change permanent. On Windows, check your PowerShell profile at `$PROFILE` and your User environment variables for `ANTHROPIC_API_KEY`. Run `/status` inside Claude Code to confirm which authentication method is active.
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -36,6 +36,7 @@ `App unavailable in region`| Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). `unable to get local issuer certificate`| Configure corporate CA certificates `OAuth error` or `403 Forbidden`| Fix authentication +`Unable to connect to Anthropic services` during setup| See [Unable to connect to Anthropic services](</docs/en/errors#unable-to-connect-to-anthropic-services>) in the Error reference `Could not load the default credentials` or `Could not load credentials from any providers`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials `ChainedTokenCredential authentication failed` or `CredentialUnavailableError`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials `API Error: 500`, `529 Overloaded`, `429`, or other 4xx and 5xx errors not listed above| See the [Error reference](</docs/en/errors>) @@ -353,16 +354,34 @@ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 irm https://claude.ai/install.ps1 | iex - 3. **Check for proxy or firewall interference** : corporate proxies that perform TLS inspection can cause these errors, including `unable to get local issuer certificate` and `SELF_SIGNED_CERT_IN_CHAIN`. For the install step, point curl at your corporate CA bundle with `--cacert`: - - curl --cacert /path/to/corporate-ca.pem -fsSL https://claude.ai/install.sh | bash + 3. **Check for proxy or firewall interference** : corporate proxies that perform TLS inspection can cause these errors, including `unable to get local issuer certificate` and `SELF_SIGNED_CERT_IN_CHAIN`. For the install step, make the install download trust your corporate proxy’s CA: + + * macOS/Linux + + * Windows PowerShell + + curl --cacert /path/to/corporate-ca.pem -fsSL https://claude.ai/install.sh | bash + +The PowerShell installer downloads through .NET, which validates TLS against the Windows certificate store. Ask your IT team to add the proxy’s CA certificate to the Windows store if it isn’t already there, then run the installer: + + irm https://claude.ai/install.ps1 | iex For Claude Code itself once installed, set `NODE_EXTRA_CA_CERTS` so API requests trust the same bundle: - export NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem + * macOS/Linux + + * Windows PowerShell + + export NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem + + $env:NODE_EXTRA_CA_CERTS = 'C:\path\to\corporate-ca.pem' Ask your IT team for the certificate file if you don’t have it. You can also try on a direct connection to confirm the proxy is the cause. - 4. **On Windows, switch installers if your network blocks revocation checks**. The errors `CRYPT_E_NO_REVOCATION_CHECK (0x80092012)` and `CRYPT_E_REVOCATION_OFFLINE (0x80092013)` mean curl reached the server but your network blocks the certificate revocation lookup, which is common behind corporate firewalls. Adding curl’s `--ssl-revoke-best-effort` flag doesn’t fix this: the flag only applies to downloading `install.cmd` itself, and the script’s own downloads run without it, so the install fails with the same error. Use an install method that tolerates the blocked lookup instead. Open PowerShell and run the PowerShell installer, which downloads through .NET and doesn’t fail when the revocation server is unreachable: + 4. **On Windows, work around blocked revocation checks**. The errors `CRYPT_E_NO_REVOCATION_CHECK (0x80092012)` and `CRYPT_E_REVOCATION_OFFLINE (0x80092013)` mean curl reached the server but your network blocks the certificate revocation lookup, which is common behind corporate firewalls. If the failing command is the `curl` that downloads `install.cmd`, rerun it from a Command Prompt with `--ssl-revoke-best-effort` added: + + curl --ssl-revoke-best-effort -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd + +When the script’s own downloads hit the same errors, it retries them with best-effort revocation checking automatically, so the flag is only needed on the command you run yourself. Best-effort checking tolerates an unreachable revocation server but still rejects a certificate that is known to be revoked, matching how browsers handle revocation. You can also avoid curl’s revocation check entirely by running the PowerShell installer from PowerShell, which downloads through .NET and doesn’t fail when the revocation server is unreachable: irm https://claude.ai/install.ps1 | iex @@ -500,9 +519,7 @@ WORKDIR /tmp RUN curl -fsSL https://claude.ai/install.sh | bash - 2. **Increase Docker memory limits** if using Docker Desktop: - - docker build --memory=4g . + 2. **Give Docker more memory** if using Docker Desktop. Build containers share the memory allocated to the Docker Desktop virtual machine, so open **Settings > Resources** in Docker Desktop, raise the memory limit, and rerun the build. ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -58,9 +58,17 @@ The installer downloads from `downloads.claude.ai`. Verify you can reach it: + * macOS/Linux + + * Windows PowerShell + curl -sI https://downloads.claude.ai/claude-code-releases/latest -In PowerShell, run `curl.exe -sI` instead. PowerShell aliases `curl` to `Invoke-WebRequest`, which rejects the `-sI` flags. An `HTTP/2 200` line means you reached the server. Other results point to the cause: + curl.exe -sI https://downloads.claude.ai/claude-code-releases/latest + +PowerShell aliases `curl` to `Invoke-WebRequest`, which rejects the `-sI` flags, so call `curl.exe` explicitly. + +You reached the server if the first line shows a `200` status. You see `HTTP/2 200` on macOS and Linux, and `HTTP/1.1 200 OK` from the `curl.exe` included with Windows. Other results point to the cause: * `403`: usually a proxy or network filter blocking the host, or Claude Code is [not available in your region](<https://www.anthropic.com/supported-countries>) * `5xx`: usually a temporary service issue; wait a few minutes and retry
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -268,6 +268,7 @@ winget install Anthropic.ClaudeCode +Then run `claude --version` to confirm: the command prints a version number such as `2.1.211 (Claude Code)`. If the shell reports `claude` isn’t found, open a new terminal window and retry: the session you installed from keeps its old `PATH`. 2. **Retry after a few minutes** : the issue is often temporary. Wait and try the original command again. ### @@ -311,6 +312,8 @@ winget install Anthropic.ClaudeCode +Then run `claude --version` to confirm: the command prints a version number such as `2.1.211 (Claude Code)`. If the shell reports `claude` isn’t found, open a new terminal window and retry: the session you installed from keeps its old `PATH`. + ### ​ @@ -385,6 +388,8 @@ winget install Anthropic.ClaudeCode +Then run `claude --version` to confirm: the command prints a version number such as `2.1.211 (Claude Code)`. If the shell reports `claude` isn’t found, open a new terminal window and retry: the session you installed from keeps its old `PATH`. + ### ​ @@ -451,10 +456,10 @@ Install killed on low-memory Linux servers -A `Killed` message during install usually means the Linux out-of-memory (OOM) killer terminated the `claude install` step because the system ran out of free memory. This is common on small VPS and cloud instances. The install script reports the cause and exits with code 137: +A `Killed` message during install usually means the Linux out-of-memory (OOM) killer terminated the `claude install` step because the system ran out of free memory. This is common on small VPS and cloud instances. The install script reports the cause and exits with code 137. In this example, the line number and process ID vary by release and run: Setting up Claude Code... - bash: line 142: 34803 Killed "$binary_path" install ${TARGET:+"$TARGET"} + bash: line 183: 34803 Killed "$binary_path" install ${TARGET:+"$TARGET"} Installation was killed before it could finish (exit code 137). This usually means the system ran out of memory. Claude Code needs roughly 512MB of free memory to install. Free up memory, then run this script again.
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -525,7 +525,7 @@ } } -If your Git is installed somewhere else, find the path by running `where.exe git` in PowerShell and use the `bin\bash.exe` path from that directory. **If the path is correct and the file exists** but Claude Code still reports it as not found, endpoint security software such as AppLocker, Group Policy software restriction policies, or EDR agents may be interfering. On versions before v2.1.116, Claude Code spawned a child process (`cmd.exe`) to verify the path, which these policies can block — a common signal is that `cmd.exe /c dir "C:\Program Files\Git\bin\bash.exe"` works when you run it directly in PowerShell but fails silently when launched by `claude.exe`. Claude Code v2.1.116 and later check the filesystem directly, so update first. If the error persists on a current version, ask your IT team to allowlist `claude.exe` and the processes it spawns, including `cmd.exe` and `bash.exe`, in your endpoint protection policy. +If your Git is installed somewhere else, find the path by running `where.exe git` in PowerShell and use the `bin\bash.exe` path from that directory. **If the path is correct and the file exists** but Claude Code still doesn’t use it, check the file’s name first. Claude Code accepts only a file named `bash.exe`, `sh.exe`, `bash`, or `sh`; with any other name, such as Git for Windows’ `git-bash.exe` launcher, it ignores the variable and auto-detects Git Bash as if it were unset, logging a warning visible with `--debug`. A path that doesn’t exist gets the same fallback and warning. Before v2.1.219, Claude Code used any existing file as the shell without checking its name, and exited at startup with `Claude Code was unable to find CLAUDE_CODE_GIT_BASH_PATH path` when the path didn’t exist. If the file’s name is right, endpoint security software such as AppLocker, Group Policy software restriction policies, or EDR agents may be interfering. On versions before v2.1.116, Claude Code spawned a `cmd.exe` child process to verify the path, which these policies can block. A common signal is that `cmd.exe /c dir "C:\Program Files\Git\bin\bash.exe"` works when you run it directly in PowerShell but fails silently when launched by `claude.exe`. Claude Code v2.1.116 and later check the filesystem directly, so update first. If the error persists on a current version, ask your IT team to allowlist `claude.exe` and the processes it spawns, including `cmd.exe` and `bash.exe`, in your endpoint protection policy. ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -30,7 +30,9 @@ PowerShell installer completes but `claude` is not found or shows an old version| Add the install directory to your PATH, then open a new terminal `dyld: cannot load`, `dyld: Symbol not found`, or `Abort trap` on macOS| Binary incompatibility `claude update` hangs after `Checking for updates`, or `claude doctor` hangs with no output| Move the directory at a shell config path -`Invoke-Expression: Missing argument in parameter list`| Install script returns HTML +`Invoke-Expression` or `iex` parse errors quoting HTML tags or CSS, or `ParserError` with `ParseException`| Install script returns HTML +`running scripts is disabled on this system` or `PSSecurityException`| Allow the npm shims to run +`Error: claude native binary not installed`| Complete the npm install `App unavailable in region`| Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). `unable to get local issuer certificate`| Configure corporate CA certificates `OAuth error` or `403 Forbidden`| Fix authentication @@ -245,11 +247,14 @@ bash: line 1: syntax error near unexpected token `<' bash: line 1: `<!DOCTYPE html>' -On PowerShell, the same problem appears as: - - Invoke-Expression: Missing argument in parameter list. - -Depending on how the request was routed, you may instead see a 403 with no HTML body: +On PowerShell, the same problem appears as parse errors pointing into the returned page, with `iex` trying to run HTML and CSS as PowerShell: + + iex : At line:1 char:2310 + + ... igin="anonymous"/><script type="text/javascript">!function(o,c){var n ... + Missing argument in parameter list. + ... + +The wording varies with the PowerShell version and system language: you may see `Missing expression after unary operator '--'` or a `ParserError` with `ParseException` instead. HTML tags or CSS in the quoted text identify this failure. If you download with `-OutFile install.ps1` instead, the saved file is the same web page, so that doesn’t help either. Depending on how the request was routed, you may instead see a 403 with no HTML body: curl: (22) The requested URL returned error: 403 @@ -412,6 +417,27 @@ ​ +`running scripts is disabled on this system` + +Installing or running Claude Code through npm on Windows can fail with a `SecurityError`: + + npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. + ... + + CategoryInfo : SecurityError: (:) [], PSSecurityException + +The same error names `claude.ps1` when you run `claude` after an npm install. PowerShell’s execution policy is blocking the `.ps1` launcher scripts that npm creates for its commands. The policy applies to script files, so it doesn’t affect the PowerShell installer `irm https://claude.ai/install.ps1 | iex`, which runs the downloaded text directly. **Solutions:** + + 1. **Allow locally created scripts for your user** , then retry: + + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser + + 2. **Call the`.cmd` launcher instead**: `npm.cmd` and `claude.cmd` do the same job, and the policy doesn’t cover them. + 3. **Use the[PowerShell installer](</docs/en/setup#install-claude-code>)** instead of npm. It installs a binary rather than a `.ps1` script. + +### + +​ + `The process cannot access the file` during Windows install If the PowerShell installer fails with `Failed to download binary: The process cannot access the file ... because it is being used by another process`, the installer couldn’t write to `%USERPROFILE%\.claude\downloads`. This usually means a previous install attempt is still running, or antivirus software is scanning a partially downloaded binary in that folder. Close any other PowerShell windows running the installer and wait for antivirus scans to release the file. Then delete the downloads folder and run the installer again: @@ -623,13 +649,27 @@ Native binary not found after npm install -The `@anthropic-ai/claude-code` npm package pulls in the native binary through a per-platform optional dependency such as `@anthropic-ai/claude-code-darwin-arm64`. If running `claude` after install prints `Could not find native binary package "@anthropic-ai/claude-code-<platform>"`, check the following causes: - - * **Optional dependencies are disabled.** Remove `--omit=optional` from your npm install command, `--no-optional` from pnpm, or `--ignore-optional` from yarn, and check that `.npmrc` does not set `optional=false`. Then reinstall. The native binary is delivered only as an optional dependency, so there is no JavaScript fallback if it is skipped. +The `@anthropic-ai/claude-code` npm package downloads the native binary as a per-platform optional dependency, such as `@anthropic-ai/claude-code-darwin-arm64`. npm then runs the package’s postinstall script, which copies that binary into place as the `claude` command; until it runs, `claude` is a placeholder script. If either the download or the postinstall step is skipped, the placeholder stays in place, and running `claude` on macOS and Linux prints: + + Error: claude native binary not installed. + + Either postinstall did not run (--ignore-scripts, some pnpm configs) + or the platform-native optional dependency was not downloaded + (--omit=optional). + + Run the postinstall manually (adjust path for local vs global install): + node node_modules/@anthropic-ai/claude-code/install.cjs + + Or reinstall without --ignore-scripts / --omit=optional. + +On Windows, `bin/claude.exe` is that same shell-script placeholder rather than a real executable, so PowerShell and CMD report that they can’t run the file instead of printing this message. Check the following causes: + + * **Optional dependencies are disabled.** Remove `--omit=optional` from your npm install command, `--no-optional` from pnpm, or `--ignore-optional` from yarn, and check that `.npmrc` does not set `optional=false`. Then reinstall. The native binary is delivered only as an optional dependency, so there is no JavaScript fallback if it is skipped, and running `install.cjs` again can’t place a binary that was never downloaded. + * **Install scripts are disabled.** `--ignore-scripts` and some pnpm configurations skip the postinstall step but still download the platform package. Run `node node_modules/@anthropic-ai/claude-code/install.cjs` as the message suggests, or reinstall without the flag. If postinstall can’t run in your environment at all, `node node_modules/@anthropic-ai/claude-code/cli-wrapper.cjs` finds the downloaded package and launches it, at the cost of an extra Node process on each start. If the wrapper prints `Could not find native binary package` instead, the platform package was never downloaded, so fix the optional-dependencies cause above first. * **Unsupported platform.** Prebuilt binaries are published for `darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `linux-x64-musl`, `linux-arm64-musl`, `win32-x64`, and `win32-arm64`. Claude Code does not ship a binary for other platforms; see the [system requirements](</docs/en/setup#system-requirements>). On FreeBSD, the installer reports the platform as unsupported. Before v2.1.205, it treated FreeBSD as Linux and downloaded a binary that couldn’t run. * **Corporate npm mirror is missing the platform packages.** Ensure your registry mirrors all eight `@anthropic-ai/claude-code-*` platform packages in addition to the meta package. -Installing with `--ignore-scripts` does not trigger this error. The postinstall step that links the binary into place is skipped, so Claude Code falls back to a wrapper that locates and spawns the platform binary on each launch. This works but starts more slowly; reinstall with scripts enabled for direct execution. +Before v2.1.113, the npm package shipped Claude Code as JavaScript that ran directly in Node rather than as a native binary, so there was no download or postinstall step to skip and this error didn’t exist. ##
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -29,6 +29,7 @@ `cannot execute binary file: Exec format error` in WSL| WSL1 native-binary regression PowerShell installer completes but `claude` is not found or shows an old version| Add the install directory to your PATH, then open a new terminal `dyld: cannot load`, `dyld: Symbol not found`, or `Abort trap` on macOS| Binary incompatibility +`claude update` hangs after `Checking for updates`, or `claude doctor` hangs with no output| Move the directory at a shell config path `Invoke-Expression: Missing argument in parameter list`| Install script returns HTML `App unavailable in region`| Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). `unable to get local issuer certificate`| Configure corporate CA certificates @@ -468,6 +469,18 @@ ​ +`claude update` or `claude doctor` hangs + +`claude update` and `claude doctor` scan your shell configuration files for an outdated `claude` alias: `~/.zshrc`, `~/.bashrc`, and `~/.config/fish/config.fish`, plus on macOS the first of `~/.bash_profile`, `~/.bash_login`, or `~/.profile` that exists. If you set `ZDOTDIR`, the Zsh file is `$ZDOTDIR/.zshrc` instead. When one of those paths is a directory, Claude Code skips it and both commands complete normally. Before v2.1.214, a directory at one of those paths made both commands hang and left the System diagnostics section of `/status` blank. `claude doctor` hung with no output; `claude update` hung right after printing `Checking for updates`. If you hit the hang on an earlier version, find the directory. In this command’s output, a line starting with `d` marks that path as a directory. A `No such file or directory` line means nothing exists at that path and isn’t the cause: + + ls -ld ~/.zshrc ~/.bashrc ~/.bash_profile ~/.bash_login ~/.profile ~/.config/fish/config.fish + +Move the directory aside, or update to v2.1.214 or later. Since `claude update` hangs on the affected versions, update by rerunning the [install script](</docs/en/setup#install-claude-code>) instead. + +### + +​ + Claude Desktop overrides the `claude` command on Windows If you installed an older version of Claude Desktop, it may register a `Claude.exe` in the `WindowsApps` directory that takes PATH priority over Claude Code CLI. Running `claude` opens the Desktop app instead of the CLI. Update Claude Desktop to the latest version to fix this issue.
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -57,7 +57,12 @@ curl -sI https://downloads.claude.ai/claude-code-releases/latest -In PowerShell, run `curl.exe -sI` instead. PowerShell aliases `curl` to `Invoke-WebRequest`, which rejects the `-sI` flags. An `HTTP/2 200` line means you reached the server. If you see no output, `Could not resolve host`, or a connection timeout, your network is blocking the connection. Common causes: +In PowerShell, run `curl.exe -sI` instead. PowerShell aliases `curl` to `Invoke-WebRequest`, which rejects the `-sI` flags. An `HTTP/2 200` line means you reached the server. Other results point to the cause: + + * `403`: usually a proxy or network filter blocking the host, or Claude Code is [not available in your region](<https://www.anthropic.com/supported-countries>) + * `5xx`: usually a temporary service issue; wait a few minutes and retry + +If you see no output, `Could not resolve host`, or a connection timeout, your network is blocking the connection. Common causes: * Corporate firewalls or proxies blocking `downloads.claude.ai` * Regional network restrictions: try a VPN or alternative network @@ -288,7 +293,10 @@ curl -sI https://downloads.claude.ai/claude-code-releases/latest -An `HTTP/2 200` line means you reached the server and the original failure was likely intermittent; retry the install command. If you see `Could not resolve host` or a connection timeout, your network is blocking the download. +An `HTTP/2 200` line means you reached the server and the original failure was likely intermittent; retry the install command. Other results point to the cause: + * `403`: usually a proxy or network filter blocking the host, or Claude Code is [not available in your region](<https://www.anthropic.com/supported-countries>) + * `5xx`: usually a temporary service issue; wait a few minutes and retry + * `Could not resolve host` or a connection timeout: your network is blocking the download 2. **Try an alternative install method** : On macOS: brew install --cask claude-code @@ -355,6 +363,9 @@ curl -sI https://downloads.claude.ai/claude-code-releases/latest +An `HTTP/2 200` line means the server is reachable. Other results point to the cause: + * `403`: usually a proxy or network filter blocking the host, or Claude Code is [not available in your region](<https://www.anthropic.com/supported-countries>) + * `5xx`: usually a temporary service issue; wait a few minutes and retry 2. **If behind a proxy** , set `HTTPS_PROXY` so the installer can route through it. See [proxy configuration](</docs/en/network-config#proxy-configuration>) for details. export HTTPS_PROXY=http://proxy.example.com:8080
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -722,3 +722,4 @@ 1. Check the [GitHub repository](<https://github.com/anthropics/claude-code/issues>) for known issues, or open a new one with your operating system, the install command you ran, and the full error output 2. If `claude --version` works but something else is wrong, run `claude doctor` for an automated diagnostic report 3. If you can start a session, use `/feedback` inside Claude Code to report the problem + 4. If the problem is with your account rather than the install, such as a login loop, a subscription that isn’t recognized, or a disabled organization, contact Anthropic support: sign in at [claude.ai](<https://claude.ai>) (Console users: [platform.claude.com](<https://platform.claude.com>)), click your initials in the lower left, and select **Get help**. See [How to get support](<https://support.claude.com/en/articles/9015913-how-to-get-support>) for the full flow.
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -511,6 +511,8 @@ apk add libgcc libstdc++ ripgrep +On Alpine, `ripgrep` is in the community repository. If `apk` reports that the package is missing, see [Alpine Linux setup](</docs/en/setup#alpine-linux-and-musl-based-distributions>). + ### ​ @@ -687,7 +689,7 @@ Not logged in or token expired -If Claude Code prompts you to log in again after a session, your OAuth token may have expired. Run `/login` to re-authenticate. If this happens frequently, check that your system clock is accurate, as token validation depends on correct timestamps. On macOS, login can also fail when the Keychain is locked or its password is out of sync with your account password, which prevents Claude Code from saving credentials. Run `claude doctor` to check Keychain access. To unlock the Keychain manually, run `security unlock-keychain ~/Library/Keychains/login.keychain-db`. If unlocking doesn’t help, open Keychain Access, select the `login` keychain, and choose Edit > Change Password for Keychain “login” to resync it with your account password. +If Claude Code prompts you to log in again after a session, your OAuth token may have expired. Run `/login` to re-authenticate. If this happens frequently, check that your system clock is accurate, as token validation depends on correct timestamps. Parallel sessions on one machine share a saved login and coordinate its renewal so that only one process refreshes the token at a time. Before v2.1.211, waking the machine from sleep could cause two sessions to renew with the same token, which revoked the saved login and prompted every open session to log in again at once. On macOS, login can also fail when the Keychain is locked or its password is out of sync with your account password, which prevents Claude Code from saving credentials. Run `claude doctor` to check Keychain access. To unlock the Keychain manually, run `security unlock-keychain ~/Library/Keychains/login.keychain-db`. If unlocking doesn’t help, open Keychain Access, select the `login` keychain, and choose Edit > Change Password for Keychain “login” to resync it with your account password. ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -337,11 +337,11 @@ export NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem Ask your IT team for the certificate file if you don’t have it. You can also try on a direct connection to confirm the proxy is the cause. - 4. **On Windows, bypass certificate revocation checks** if you see `CRYPT_E_NO_REVOCATION_CHECK (0x80092012)` or `CRYPT_E_REVOCATION_OFFLINE (0x80092013)`. These mean curl reached the server but your network blocks the certificate revocation lookup, which is common behind corporate firewalls. Add `--ssl-revoke-best-effort` to the install command: - - curl --ssl-revoke-best-effort -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd - -Alternatively, install with `winget install Anthropic.ClaudeCode`, which avoids curl entirely. + 4. **On Windows, switch installers if your network blocks revocation checks**. The errors `CRYPT_E_NO_REVOCATION_CHECK (0x80092012)` and `CRYPT_E_REVOCATION_OFFLINE (0x80092013)` mean curl reached the server but your network blocks the certificate revocation lookup, which is common behind corporate firewalls. Adding curl’s `--ssl-revoke-best-effort` flag doesn’t fix this: the flag only applies to downloading `install.cmd` itself, and the script’s own downloads run without it, so the install fails with the same error. Use an install method that tolerates the blocked lookup instead. Open PowerShell and run the PowerShell installer, which downloads through .NET and doesn’t fail when the revocation server is unreachable: + + irm https://claude.ai/install.ps1 | iex + +You can also install with `winget install Anthropic.ClaudeCode`, which avoids curl entirely. ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -148,7 +148,7 @@ ls -la ~/.local/bin/claude -If either `ls` command prints `No such file or directory`, that’s not an error. It means nothing is installed at that location, so move on to the next check. +A native install shows a symlink into `~/.local/share/claude/versions/`. A script or a symlink you created yourself at this path is a custom launcher, which [auto-update leaves in place](</docs/en/setup#auto-updates>).If either `ls` command prints `No such file or directory`, that’s not an error. It means nothing is installed at that location, so move on to the next check. ls -la ~/.claude/local/
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -39,7 +39,7 @@ If your issue isn’t listed, work through the diagnostic checks below to narrow down the cause. -If you’d rather skip the terminal entirely, the [Claude Code Desktop app](</docs/en/desktop-quickstart>) lets you install and use Claude Code through a graphical interface. Download it for [macOS](<https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs>), [Windows](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>), or [Linux](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>) and start coding without any command-line setup. +If you’d rather skip the terminal entirely, the [Claude Code Desktop app](</docs/en/desktop-quickstart>) lets you install and use Claude Code through a graphical interface. Download it for [macOS](<https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs>) or [Windows](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>) and start coding without any command-line setup. On Linux, install the app with apt by following the [Linux install instructions](</docs/en/desktop-linux>). ##
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -600,7 +600,7 @@ The `@anthropic-ai/claude-code` npm package pulls in the native binary through a per-platform optional dependency such as `@anthropic-ai/claude-code-darwin-arm64`. If running `claude` after install prints `Could not find native binary package "@anthropic-ai/claude-code-<platform>"`, check the following causes: * **Optional dependencies are disabled.** Remove `--omit=optional` from your npm install command, `--no-optional` from pnpm, or `--ignore-optional` from yarn, and check that `.npmrc` does not set `optional=false`. Then reinstall. The native binary is delivered only as an optional dependency, so there is no JavaScript fallback if it is skipped. - * **Unsupported platform.** Prebuilt binaries are published for `darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `linux-x64-musl`, `linux-arm64-musl`, `win32-x64`, and `win32-arm64`. Claude Code does not ship a binary for other platforms; see the [system requirements](</docs/en/setup#system-requirements>). + * **Unsupported platform.** Prebuilt binaries are published for `darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `linux-x64-musl`, `linux-arm64-musl`, `win32-x64`, and `win32-arm64`. Claude Code does not ship a binary for other platforms; see the [system requirements](</docs/en/setup#system-requirements>). On FreeBSD, the installer reports the platform as unsupported. Before v2.1.205, it treated FreeBSD as Linux and downloaded a binary that couldn’t run. * **Corporate npm mirror is missing the platform packages.** Ensure your registry mirrors all eight `@anthropic-ai/claude-code-*` platform packages in addition to the meta package. Installing with `--ignore-scripts` does not trigger this error. The postinstall step that links the binary into place is skipped, so Claude Code falls back to a wrapper that locates and spawns the platform binary on each launch. This works but starts more slowly; reinstall with scripts enabled for direct execution.
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -14,7 +14,7 @@ `syntax error near unexpected token '<'`| Install script returns HTML `curl: (22) The requested URL returned error: 403`| Install script returned 403 `curl: (23)` or `curl: (56) Failure writing output to destination`| Check connectivity or use an alternative installer -`Killed` during install on Linux| Add swap space for low-memory servers +`Killed` during install on Linux, or `Installation was killed before it could finish (exit code 137)`| Free memory or add swap space `TLS connect error` or `SSL/TLS secure channel`| Update CA certificates `Failed to fetch version` or can’t reach download server| Check network and proxy settings `irm is not recognized` or `&& is not valid`| Use the right command for your shell @@ -33,8 +33,8 @@ `App unavailable in region`| Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). `unable to get local issuer certificate`| Configure corporate CA certificates `OAuth error` or `403 Forbidden`| Fix authentication -`Could not load the default credentials` or `Could not load credentials from any providers`| Bedrock, Vertex, or Foundry credentials -`ChainedTokenCredential authentication failed` or `CredentialUnavailableError`| Bedrock, Vertex, or Foundry credentials +`Could not load the default credentials` or `Could not load credentials from any providers`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials +`ChainedTokenCredential authentication failed` or `CredentialUnavailableError`| Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry credentials `API Error: 500`, `529 Overloaded`, `429`, or other 4xx and 5xx errors not listed above| See the [Error reference](</docs/en/errors>) If your issue isn’t listed, work through the diagnostic checks below to narrow down the cause. @@ -413,13 +413,14 @@ Install killed on low-memory Linux servers -If you see `Killed` during installation on a VPS or cloud instance: +A `Killed` message during install usually means the Linux out-of-memory (OOM) killer terminated the `claude install` step because the system ran out of free memory. This is common on small VPS and cloud instances. The install script reports the cause and exits with code 137: Setting up Claude Code... - Installing Claude Code native build latest... bash: line 142: 34803 Killed "$binary_path" install ${TARGET:+"$TARGET"} - -The Linux OOM killer terminated the process because the system ran out of memory. Claude Code requires at least 4 GB of available RAM. **Solutions:** + Installation was killed before it could finish (exit code 137). This usually means the system ran out of memory. + Claude Code needs roughly 512MB of free memory to install. Free up memory, then run this script again. + +Before v2.1.200, the script exited with only the shell’s bare `Killed` line and no explanation. Installing needs roughly 512 MB of free memory, and running Claude Code needs more. See the [system requirements](</docs/en/setup#system-requirements>). **Solutions:** 1. **Add swap space** if your server has limited RAM. Swap uses disk space as overflow memory, letting the install complete even with low physical RAM. Create a 2 GB swap file and enable it: @@ -692,13 +693,13 @@ ​ -Bedrock, Vertex, or Foundry credentials not loading - -If you configured Claude Code to use a cloud provider and see `Could not load credentials from any providers` on Bedrock, `Could not load the default credentials` on Vertex, or `ChainedTokenCredential authentication failed` on Foundry, your cloud provider CLI is likely not authenticated in the current shell. For Bedrock, confirm your AWS credentials are valid: +Bedrock, Agent Platform, or Foundry credentials not loading + +If you configured Claude Code to use a cloud provider and see `Could not load credentials from any providers` on Amazon Bedrock, `Could not load the default credentials` on Google Cloud’s Agent Platform, or `ChainedTokenCredential authentication failed` on Microsoft Foundry, your cloud provider CLI is likely not authenticated in the current shell. For Amazon Bedrock, confirm your AWS credentials are valid: aws sts get-caller-identity -For Vertex AI, confirm `ANTHROPIC_VERTEX_PROJECT_ID` and `CLOUD_ML_REGION` are set in your shell, then set application default credentials: +For Google Cloud’s Agent Platform, confirm `ANTHROPIC_VERTEX_PROJECT_ID` and `CLOUD_ML_REGION` are set in your shell, then set application default credentials: gcloud auth application-default login @@ -706,7 +707,7 @@ az login -If credentials work in your terminal but not in the VS Code or JetBrains extension, the IDE process likely didn’t inherit your shell environment. Set the provider environment variables in the IDE’s own settings, or launch the IDE from a terminal where they’re already exported. See [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>) for full provider setup. +If credentials work in your terminal but not in the VS Code or JetBrains extension, the IDE process likely didn’t inherit your shell environment. Set the provider environment variables in the IDE’s own settings, or launch the IDE from a terminal where they’re already exported. See [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Cloud’s Agent Platform](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>) for full provider setup. ##
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -20,6 +20,7 @@ `irm is not recognized` or `&& is not valid`| Use the right command for your shell `Cask 'claude-code' is unavailable: No Cask with this name exists`| Update Homebrew `'bash' is not recognized as the name of a cmdlet`| Use the Windows installer command +`A parameter cannot be found that matches parameter name 'fsSL'`| Use the Windows installer command `Claude Code on Windows requires either Git for Windows (for bash) or PowerShell`| Install a shell `Claude Code does not support 32-bit Windows`| Open Windows PowerShell, not the x86 entry `The process cannot access the file ... because it is being used by another process`| Clear the downloads folder and retry @@ -38,7 +39,7 @@ If your issue isn’t listed, work through the diagnostic checks below to narrow down the cause. -If you’d rather skip the terminal entirely, the [Claude Code Desktop app](</docs/en/desktop-quickstart>) lets you install and use Claude Code through a graphical interface. Download it for [macOS](<https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs>) or [Windows](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>) and start coding without any command-line setup. +If you’d rather skip the terminal entirely, the [Claude Code Desktop app](</docs/en/desktop-quickstart>) lets you install and use Claude Code through a graphical interface. Download it for [macOS](<https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs>), [Windows](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>), or [Linux](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>) and start coding without any command-line setup. ## @@ -373,7 +374,7 @@ Wrong install command on Windows -If you see `'irm' is not recognized`, `The token '&&' is not valid`, or `'bash' is not recognized as the name of a cmdlet`, you copied the install command for a different shell or operating system. +If you see `'irm' is not recognized`, `The token '&&' is not valid`, `A parameter cannot be found that matches parameter name 'fsSL'`, or `'bash' is not recognized as the name of a cmdlet`, you copied the install command for a different shell or operating system. * **`irm` not recognized**: you’re in CMD, not PowerShell. You have two options: Open PowerShell by searching for “PowerShell” in the Start menu, then run the original install command: @@ -384,6 +385,10 @@ curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd * **`&&` not valid**: you’re in PowerShell but ran the CMD installer command. Use the PowerShell installer: + + irm https://claude.ai/install.ps1 | iex + + * **`A parameter cannot be found that matches parameter name 'fsSL'`** : you ran the macOS/Linux `curl -fsSL ... | bash` installer in Windows PowerShell, where `curl` is an alias for `Invoke-WebRequest` and rejects the `-fsSL` flags. Use the PowerShell installer instead: irm https://claude.ai/install.ps1 | iex
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -26,7 +26,7 @@ `Error loading shared library`| Wrong binary variant for your system `Illegal instruction`| Architecture or CPU instruction set mismatch `cannot execute binary file: Exec format error` in WSL| WSL1 native-binary regression -PowerShell installer completes but `claude` is not found or shows an old version| Restart your terminal and verify PATH +PowerShell installer completes but `claude` is not found or shows an old version| Add the install directory to your PATH, then open a new terminal `dyld: cannot load`, `dyld: Symbol not found`, or `Abort trap` on macOS| Binary incompatibility `Invoke-Expression: Missing argument in parameter list`| Install script returns HTML `App unavailable in region`| Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>).
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -18,6 +18,7 @@ `TLS connect error` or `SSL/TLS secure channel`| Update CA certificates `Failed to fetch version` or can’t reach download server| Check network and proxy settings `irm is not recognized` or `&& is not valid`| Use the right command for your shell +`Cask 'claude-code' is unavailable: No Cask with this name exists`| Update Homebrew `'bash' is not recognized as the name of a cmdlet`| Use the Windows installer command `Claude Code on Windows requires either Git for Windows (for bash) or PowerShell`| Install a shell `Claude Code does not support 32-bit Windows`| Open Windows PowerShell, not the x86 entry @@ -299,6 +300,19 @@ ​ +Homebrew cask unavailable or outdated + +Homebrew reports `Error: Cask 'claude-code' is unavailable: No Cask with this name exists` when your local copy of the Homebrew cask index predates the cask’s publication. Refresh the index and retry: + + brew update + brew install --cask claude-code + +If Homebrew installs an older Claude Code version than you expect, the same stale index is usually the cause. The `claude-code` cask tracks the stable channel and is typically about one week behind the latest release; for the newest version run `brew install --cask claude-code@latest` instead. See [Configure release channel](</docs/en/setup#configure-release-channel>) for the difference between the two casks. + +### + +​ + TLS or SSL connection errors Errors like `curl: (35) TLS connect error`, `schannel: next InitializeSecurityContext failed`, or PowerShell’s `Could not establish trust relationship for the SSL/TLS secure channel` indicate TLS handshake failures. **Solutions:**
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -81,7 +81,11 @@ Verify your PATH -If installation succeeded but you get a `command not found` or `not recognized` error when running `claude`, the install directory isn’t in your PATH. Your shell searches for programs in directories listed in PATH, and the installer places `claude` at `~/.local/bin/claude` on macOS/Linux or `%USERPROFILE%\.local\bin\claude.exe` on Windows. Check if the install directory is in your PATH by listing your PATH entries and filtering for `local/bin`: +If installation succeeded but you get a `command not found` or `not recognized` error when running `claude`, the install directory isn’t in your PATH. Your shell searches for programs in directories listed in PATH, and the installer places `claude` at `~/.local/bin/claude` on macOS/Linux or `%USERPROFILE%\.local\bin\claude.exe` on Windows. + +The [VS Code extension](</docs/en/vs-code>) does not place `claude` at this location. It bundles a private copy of the CLI inside the extension directory for its own chat panel and does not add it to PATH. If you have only installed the extension, `~/.local/bin/claude` will not exist. Run the [standalone install](</docs/en/setup>) to use `claude` from a terminal, then continue below. + +Check if the install directory is in your PATH by listing your PATH entries and filtering for `local/bin`: * macOS/Linux
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -142,6 +142,8 @@ ls -la ~/.local/bin/claude +If either `ls` command prints `No such file or directory`, that’s not an error. It means nothing is installed at that location, so move on to the next check. + ls -la ~/.claude/local/ npm -g ls @anthropic-ai/claude-code 2>/dev/null @@ -449,7 +451,7 @@ } } -If your Git is installed somewhere else, find the path by running `where.exe git` in PowerShell and use the `bin\bash.exe` path from that directory. +If your Git is installed somewhere else, find the path by running `where.exe git` in PowerShell and use the `bin\bash.exe` path from that directory. **If the path is correct and the file exists** but Claude Code still reports it as not found, endpoint security software such as AppLocker, Group Policy software restriction policies, or EDR agents may be interfering. On versions before v2.1.116, Claude Code spawned a child process (`cmd.exe`) to verify the path, which these policies can block — a common signal is that `cmd.exe /c dir "C:\Program Files\Git\bin\bash.exe"` works when you run it directly in PowerShell but fails silently when launched by `claude.exe`. Claude Code v2.1.116 and later check the filesystem directly, so update first. If the error persists on a current version, ask your IT team to allowlist `claude.exe` and the processes it spawns, including `cmd.exe` and `bash.exe`, in your endpoint protection policy. ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -55,7 +55,7 @@ curl -sI https://downloads.claude.ai/claude-code-releases/latest -An `HTTP/2 200` line means you reached the server. If you see no output, `Could not resolve host`, or a connection timeout, your network is blocking the connection. Common causes: +In PowerShell, run `curl.exe -sI` instead. PowerShell aliases `curl` to `Invoke-WebRequest`, which rejects the `-sI` flags. An `HTTP/2 200` line means you reached the server. If you see no output, `Could not resolve host`, or a connection timeout, your network is blocking the connection. Common causes: * Corporate firewalls or proxies blocking `downloads.claude.ai` * Regional network restrictions: try a VPN or alternative network
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -1,9 +1,3 @@ -> ## Documentation Index -> -> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> -> -> Use this file to discover all available pages before exploring further. - If installation fails or you can’t sign in, find your error below. For runtime issues after Claude Code is working, see [Troubleshooting](</docs/en/troubleshooting>). For configuration problems such as settings not applying or hooks not firing, see [Debug your configuration](</docs/en/debug-your-config>). ##
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -18,7 +18,8 @@ ---|--- `command not found: claude` or `'claude' is not recognized`| Fix your PATH `syntax error near unexpected token '<'`| Install script returns HTML -`curl: (56) Failure writing output to destination`| Check connectivity or use an alternative installer +`curl: (22) The requested URL returned error: 403`| Install script returned 403 +`curl: (23)` or `curl: (56) Failure writing output to destination`| Check connectivity or use an alternative installer `Killed` during install on Linux| Add swap space for low-memory servers `TLS connect error` or `SSL/TLS secure channel`| Update CA certificates `Failed to fetch version` or can’t reach download server| Check network and proxy settings @@ -240,7 +241,11 @@ Invoke-Expression: Missing argument in parameter list. -This means the install URL returned an HTML page instead of the install script. If the HTML page says “App unavailable in region,” Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). Otherwise, this can happen due to network issues, regional routing, or a temporary service disruption. **Solutions:** +Depending on how the request was routed, you may instead see a 403 with no HTML body: + + curl: (22) The requested URL returned error: 403 + +These all mean the install URL returned an HTML page or an error status instead of the install script. If the HTML page says “App unavailable in region,” Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). A bare 403 with no body often has the same cause, but it can also come from a corporate proxy or firewall blocking the download. If you are in a supported country and still see the 403, work through Check network connectivity before trying the alternative installers below, since those reach the same hosts. Otherwise, this can happen due to network issues, regional routing, or a temporary service disruption. **Solutions:** 1. **Use an alternative install method** : On macOS, install via Homebrew: @@ -275,7 +280,7 @@ `curl: (56) Failure writing output to destination` -The `curl ... | bash` command downloads the script and pipes it to Bash for execution. This error means the connection broke before the script finished downloading. Common causes include network interruptions, the download being blocked mid-stream, or system resource limits. **Solutions:** +The `curl ... | bash` command downloads the script and pipes it to Bash for execution. This error, and the related `curl: (23) Failure writing output to destination`, means Bash did not receive the complete script. Exit code 56 indicates the download itself was interrupted, and exit code 23 indicates curl could not write what it received to the pipe, usually because Bash exited early. **Solutions:** 1. **Check network stability** : Claude Code binaries are hosted at `downloads.claude.ai`. Test that you can reach it: @@ -442,12 +447,7 @@ Claude Code on Windows requires either Git for Windows (for bash) or PowerShell -Claude Code on native Windows needs at least one shell: either [Git for Windows](<https://git-scm.com/downloads/win>) for Bash, or PowerShell. When neither is found, this error appears at startup. If only PowerShell is found, Claude Code uses the PowerShell tool instead of Bash. **If neither is installed** , install one: - - * Git for Windows: download from [git-scm.com/downloads/win](<https://git-scm.com/downloads/win>). During setup, select “Add to PATH.” Restart your terminal after installing. - * PowerShell 7: download from [aka.ms/powershell](<https://aka.ms/powershell>). - -**If Git is already installed** but Claude Code can’t find it, set the path in your [settings.json file](</docs/en/settings>): +Git for Windows is optional. Claude Code uses the [PowerShell tool](</docs/en/tools-reference#powershell-tool>) when Git Bash is absent, so this error means neither shell was found. **If PowerShell is missing from your PATH** , its default location is `C:\Windows\System32\WindowsPowerShell\v1.0\`. Add that directory to your `PATH`, or install [PowerShell 7](<https://aka.ms/powershell>), which provides `pwsh`. **To install Git for Windows instead** , download it from [git-scm.com/downloads/win](<https://git-scm.com/downloads/win>). During setup, select “Add to PATH.” Restart your terminal after installing. Installing it enables the Bash tool, useful when working with Bash-based scripts and tooling. **If Git is already installed** but Claude Code can’t find it, set the path in your [settings.json file](</docs/en/settings>): { "env": {
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -497,7 +497,7 @@ `Illegal instruction` -If running `claude` or the installer prints `Illegal instruction`, the native binary uses CPU instructions your processor doesn’t support. There are two distinct causes. **Architecture mismatch.** The installer downloaded the wrong binary, for example x86 on an ARM server. Check with `uname -m` on macOS or Linux, or `$env:PROCESSOR_ARCHITECTURE` in PowerShell. If the result doesn’t match the binary you received, [file a GitHub issue](<https://github.com/anthropics/claude-code/issues>) with the output. **Missing instruction set on older CPUs.** If your architecture is correct but you still see `Illegal instruction`, your CPU likely lacks AVX or another instruction the binary requires. This affects roughly pre-2013 Intel and AMD processors. There is currently no native-binary workaround; track [issue #50384](<https://github.com/anthropics/claude-code/issues/50384>) for status, and include your CPU model from `cat /proc/cpuinfo | grep "model name" | head -1` on Linux or `sysctl -n machdep.cpu.brand_string` on macOS when reporting. Alternative install methods download the same native binary and won’t resolve either cause. +If running `claude` or the installer prints `Illegal instruction`, the native binary uses CPU instructions your processor doesn’t support. There are two distinct causes. **Architecture mismatch.** The installer downloaded the wrong binary, for example x86 on an ARM server. Check with `uname -m` on macOS or Linux, or `$env:PROCESSOR_ARCHITECTURE` in PowerShell. If the result doesn’t match the binary you received, [file a GitHub issue](<https://github.com/anthropics/claude-code/issues>) with the output. **Missing AVX instruction set.** If your architecture is correct but you still see `Illegal instruction`, your CPU likely lacks AVX or another instruction the binary requires. This affects roughly pre-2013 Intel and AMD processors, and virtual machines where the hypervisor does not pass AVX through to the guest. On a VPS or VM, run `grep -m1 -ow avx /proc/cpuinfo`; an empty result means AVX is not available to the guest. There is no native-binary workaround; track [issue #50384](<https://github.com/anthropics/claude-code/issues/50384>) for status, and include your CPU model from `grep -m1 "model name" /proc/cpuinfo` on Linux or `sysctl -n machdep.cpu.brand_string` on macOS when reporting. Alternative install methods download the same native binary and won’t resolve either cause. ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -648,18 +648,18 @@ ​ -OAuth login fails in WSL2 - -Browser-based login in WSL2 can fail in two ways: WSL can’t open your Windows browser, or the terminal won’t accept the pasted authorization code. If the browser doesn’t open, set the `BROWSER` environment variable to your Windows browser path: +OAuth login fails in WSL2, SSH, or containers + +When Claude Code runs in WSL2, on a remote machine over SSH, or inside a container, the browser usually opens on a different host and its redirect can’t reach Claude Code’s local callback server. After you sign in, the browser shows a login code instead of redirecting back automatically. Paste that code into the terminal at the `Paste code here if prompted` prompt to complete login. If the browser doesn’t open at all from WSL2, set the `BROWSER` environment variable to your Windows browser path: export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe" claude -Or press `c` at the login prompt to copy the OAuth URL and paste it into your Windows browser yourself. If the browser opens but pasting the code back into the terminal does nothing, your terminal’s paste binding likely isn’t reaching the prompt. Try your terminal’s alternate paste shortcut, often right-click or Shift+Insert in Windows Terminal, or run login outside the interactive UI: +Alternatively, press `c` at the interactive login prompt to copy the OAuth URL, or copy the URL that `claude auth login` prints, and open it in a browser on your local machine. If pasting the code into the interactive prompt does nothing, your terminal’s paste binding likely isn’t reaching the input field. Try your terminal’s alternate paste shortcut, often right-click or Shift+Insert in Windows Terminal, or use `claude auth login` instead, which reads the pasted code from standard input: claude auth login -This fallback also applies on native Windows or any terminal where pasting the code into the interactive prompt fails. +This fallback also applies on native Windows or any terminal where pasting into the interactive prompt fails. ###
modified
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -26,6 +26,7 @@ `'bash' is not recognized as the name of a cmdlet`| Use the Windows installer command `Claude Code on Windows requires either Git for Windows (for bash) or PowerShell`| Install a shell `Claude Code does not support 32-bit Windows`| Open Windows PowerShell, not the x86 entry +`The process cannot access the file ... because it is being used by another process`| Clear the downloads folder and retry `Error loading shared library`| Wrong binary variant for your system `Illegal instruction`| Architecture or CPU instruction set mismatch `cannot execute binary file: Exec format error` in WSL| WSL1 native-binary regression @@ -105,7 +106,7 @@ echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc source ~/.bashrc -Alternatively, close and reopen your terminal.Verify the fix worked: +Alternatively, close and reopen your terminal.For other shells such as fish or Nushell, add `~/.local/bin` to your PATH using your shell’s own configuration syntax, then restart your terminal.Verify the fix worked: claude --version @@ -375,6 +376,17 @@ ​ +`The process cannot access the file` during Windows install + +If the PowerShell installer fails with `Failed to download binary: The process cannot access the file ... because it is being used by another process`, the installer couldn’t write to `%USERPROFILE%\.claude\downloads`. This usually means a previous install attempt is still running, or antivirus software is scanning a partially downloaded binary in that folder. Close any other PowerShell windows running the installer and wait for antivirus scans to release the file. Then delete the downloads folder and run the installer again: + + Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\downloads" + irm https://claude.ai/install.ps1 | iex + +### + +​ + Install killed on low-memory Linux servers If you see `Killed` during installation on a VPS or cloud instance:
added
Show diff (693 lines)
--- a/troubleshoot-install.md +++ b/troubleshoot-install.md @@ -0,0 +1,690 @@ +> ## Documentation Index +> +> Fetch the complete documentation index at: <https://code.claude.com/docs/llms.txt> +> +> Use this file to discover all available pages before exploring further. + +If installation fails or you can’t sign in, find your error below. For runtime issues after Claude Code is working, see [Troubleshooting](</docs/en/troubleshooting>). For configuration problems such as settings not applying or hooks not firing, see [Debug your configuration](</docs/en/debug-your-config>). + +## + +​ + +Find your error + +Match the error message or symptom you’re seeing to a fix: + +What you see| Solution +---|--- +`command not found: claude` or `'claude' is not recognized`| Fix your PATH +`syntax error near unexpected token '<'`| Install script returns HTML +`curl: (56) Failure writing output to destination`| Check connectivity or use an alternative installer +`Killed` during install on Linux| Add swap space for low-memory servers +`TLS connect error` or `SSL/TLS secure channel`| Update CA certificates +`Failed to fetch version` or can’t reach download server| Check network and proxy settings +`irm is not recognized` or `&& is not valid`| Use the right command for your shell +`'bash' is not recognized as the name of a cmdlet`| Use the Windows installer command +`Claude Code on Windows requires either Git for Windows (for bash) or PowerShell`| Install a shell +`Claude Code does not support 32-bit Windows`| Open Windows PowerShell, not the x86 entry +`Error loading shared library`| Wrong binary variant for your system +`Illegal instruction`| Architecture or CPU instruction set mismatch +`cannot execute binary file: Exec format error` in WSL| WSL1 native-binary regression +PowerShell installer completes but `claude` is not found or shows an old version| Restart your terminal and verify PATH +`dyld: cannot load`, `dyld: Symbol not found`, or `Abort trap` on macOS| Binary incompatibility +`Invoke-Expression: Missing argument in parameter list`| Install script returns HTML +`App unavailable in region`| Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). +`unable to get local issuer certificate`| Configure corporate CA certificates +`OAuth error` or `403 Forbidden`| Fix authentication +`Could not load the default credentials` or `Could not load credentials from any providers`| Bedrock, Vertex, or Foundry credentials +`ChainedTokenCredential authentication failed` or `CredentialUnavailableError`| Bedrock, Vertex, or Foundry credentials +`API Error: 500`, `529 Overloaded`, `429`, or other 4xx and 5xx errors not listed above| See the [Error reference](</docs/en/errors>) + +If your issue isn’t listed, work through the diagnostic checks below to narrow down the cause. + +If you’d rather skip the terminal entirely, the [Claude Code Desktop app](</docs/en/desktop-quickstart>) lets you install and use Claude Code through a graphical interface. Download it for [macOS](<https://claude.ai/api/desktop/darwin/universal/dmg/latest/redirect?utm_source=claude_code&utm_medium=docs>) or [Windows](<https://claude.com/download?utm_source=claude_code&utm_medium=docs>) and start coding without any command-line setup. + +## + +​ + +Run diagnostic checks + +### + +​ + +Check network connectivity + +The installer downloads from `downloads.claude.ai`. Verify you can reach it: + + curl -sI https://downloads.claude.ai/claude-code-releases/latest + +An `HTTP/2 200` line means you reached the server. If you see no output, `Could not resolve host`, or a connection timeout, your network is blocking the connection. Common causes: + + * Corporate firewalls or proxies blocking `downloads.claude.ai` + * Regional network restrictions: try a VPN or alternative network + * TLS/SSL issues: update your system’s CA certificates, or check if `HTTPS_PROXY` is configured + +If you’re behind a corporate proxy, set `HTTPS_PROXY` and `HTTP_PROXY` to your proxy’s address before installing. Ask your IT team for the proxy URL if you don’t know it, or check your browser’s proxy settings. This example sets both proxy variables, then runs the installer through your proxy: + + * macOS/Linux + + * Windows PowerShell + + export HTTP_PROXY=http://proxy.example.com:8080 + export HTTPS_PROXY=http://proxy.example.com:8080 + curl -fsSL https://claude.ai/install.sh | bash + + $env:HTTP_PROXY = 'http://proxy.example.com:8080' + $env:HTTPS_PROXY = 'http://proxy.example.com:8080' + irm https://claude.ai/install.ps1 | iex + +### + +​ + +Verify your PATH + +If installation succeeded but you get a `command not found` or `not recognized` error when running `claude`, the install directory isn’t in your PATH. Your shell searches for programs in directories listed in PATH, and the installer places `claude` at `~/.local/bin/claude` on macOS/Linux or `%USERPROFILE%\.local\bin\claude.exe` on Windows. Check if the install directory is in your PATH by listing your PATH entries and filtering for `local/bin`: + + * macOS/Linux + + * Windows PowerShell + + * Windows CMD + + echo $PATH | tr ':' '\n' | grep -Fx "$HOME/.local/bin" + +If this prints `/Users/you/.local/bin` or `/home/you/.local/bin`, the directory is in your PATH and you can skip to Check for conflicting installations. If there’s no output, add it to your shell configuration.For Zsh, the default on macOS: + + echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc + source ~/.zshrc + +For Bash, the default on most Linux distributions: + + echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc + source ~/.bashrc + +Alternatively, close and reopen your terminal.Verify the fix worked: + + claude --version + + $env:PATH -split ';' | Select-String '\.local\\bin' + +If there’s no output, add the install directory to your User PATH: + + $currentPath = [Environment]::GetEnvironmentVariable('PATH', 'User') + [Environment]::SetEnvironmentVariable('PATH', "$currentPath;$env:USERPROFILE\.local\bin", 'User') + +Restart your terminal for the change to take effect.Verify the fix worked: + + claude --version + + echo %PATH% | findstr /i "local\bin" + +If there’s no output, open System Settings, go to Environment Variables, and add `%USERPROFILE%\.local\bin` to your User PATH variable. Restart your terminal.Verify the fix worked: + + claude --version + +### + +​ + +Check for conflicting installations + +Multiple Claude Code installations can cause version mismatches or unexpected behavior. Check what’s installed: + + * macOS/Linux + + * Windows PowerShell + +List all `claude` binaries found in your PATH: + + which -a claude + +If this prints nothing, no `claude` is on your PATH yet. Go back to Verify your PATH.Check the three locations a `claude` binary can come from. `~/.local/bin/claude` is the native installer, `~/.claude/local/` is a legacy local npm install created by older versions of Claude Code, and the npm global list shows a `-g` install: + + ls -la ~/.local/bin/claude + + ls -la ~/.claude/local/ + + npm -g ls @anthropic-ai/claude-code 2>/dev/null + +List all `claude` binaries found in your PATH: + + where.exe claude + +Check whether the native installer placed a binary: + + Test-Path "$env:USERPROFILE\.local\bin\claude.exe" + +If you find multiple installations, keep only one. The native install at `~/.local/bin/claude` on macOS/Linux or `%USERPROFILE%\.local\bin\claude.exe` on Windows is recommended. Remove the extras: Uninstall an npm global install: + + npm uninstall -g @anthropic-ai/claude-code + +Remove the legacy local npm install: + + rm -rf ~/.claude/local + +On Windows, use PowerShell: + + Remove-Item -Recurse -Force "$env:USERPROFILE\.claude\local" + +Remove a Homebrew install on macOS. If you installed the `claude-code@latest` cask, substitute that name: + + brew uninstall --cask claude-code + +Remove a WinGet install on Windows: + + winget uninstall Anthropic.ClaudeCode + +### + +​ + +Check directory permissions + +The installer needs write access to `~/.local/bin/` and `~/.claude/` on macOS and Linux. On Windows the install location is under `%USERPROFILE%`, which is writable by your user by default, so this section rarely applies there. Check whether the directories are writable: + + test -w ~/.local/bin && echo "writable" || echo "not writable" + test -w ~/.claude && echo "writable" || echo "not writable" + +If either directory isn’t writable, create the install directory and set your user as the owner: + + sudo mkdir -p ~/.local/bin + sudo chown -R $(whoami) ~/.local + +### + +​ + +Verify the binary works + +If `claude --version` prints a version but `claude` crashes or hangs on startup, run these checks to narrow down the cause. If `claude --version` says command not found, go to Verify your PATH first; the commands below assume `claude` is on your PATH. Confirm the binary exists and is executable: + + ls -la "$(command -v claude)" + +On Windows, use PowerShell: + + Get-Command claude | Select-Object Source + +On Linux, check for missing shared libraries. If `ldd` shows missing libraries, you may need to install system packages. On Alpine Linux and other musl-based distributions, see [Alpine Linux setup](</docs/en/setup#alpine-linux-and-musl-based-distributions>). + + ldd "$(command -v claude)" | grep "not found" + +Confirm the binary can execute: + + claude --version + +## + +​ + +Common installation issues + +These are the most frequently encountered installation problems and their solutions. + +### + +​ + +Install script returns HTML instead of a shell script + +When running the install command, you may see one of these errors: + + bash: line 1: syntax error near unexpected token `<' + bash: line 1: `<!DOCTYPE html>' + +On PowerShell, the same problem appears as: + + Invoke-Expression: Missing argument in parameter list. + +This means the install URL returned an HTML page instead of the install script. If the HTML page says “App unavailable in region,” Claude Code is not available in your country. See [supported countries](<https://www.anthropic.com/supported-countries>). Otherwise, this can happen due to network issues, regional routing, or a temporary service disruption. **Solutions:** + + 1. **Use an alternative install method** : On macOS, install via Homebrew: + + brew install --cask claude-code + +On Windows, install via WinGet: + + winget install Anthropic.ClaudeCode + + 2. **Retry after a few minutes** : the issue is often temporary. Wait and try the original command again. + +### + +​ + +`command not found: claude` after installation + +The install finished but `claude` doesn’t work. The exact error varies by platform: + +Platform| Error message +---|--- +macOS| `zsh: command not found: claude` +Linux| `bash: claude: command not found` +Windows CMD| `'claude' is not recognized as an internal or external command` +PowerShell| `claude : The term 'claude' is not recognized as the name of a cmdlet` + +This means the install directory isn’t in your shell’s search path. See Verify your PATH for the fix on each platform. + +### + +​ + +`curl: (56) Failure writing output to destination` + +The `curl ... | bash` command downloads the script and pipes it to Bash for execution. This error means the connection broke before the script finished downloading. Common causes include network interruptions, the download being blocked mid-stream, or system resource limits. **Solutions:** + + 1. **Check network stability** : Claude Code binaries are hosted at `downloads.claude.ai`. Test that you can reach it: + + curl -sI https://downloads.claude.ai/claude-code-releases/latest + +An `HTTP/2 200` line means you reached the server and the original failure was likely intermittent; retry the install command. If you see `Could not resolve host` or a connection timeout, your network is blocking the download. + 2. **Try an alternative install method** : On macOS: + + brew install --cask claude-code + +On Windows: + + winget install Anthropic.ClaudeCode + +### + +​ + +TLS or SSL connection errors + +Errors like `curl: (35) TLS connect error`, `schannel: next InitializeSecurityContext failed`, or PowerShell’s `Could not establish trust relationship for the SSL/TLS secure channel` indicate TLS handshake failures. **Solutions:** + + 1. **Update your system CA certificates** : On Ubuntu/Debian: + + sudo apt-get update && sudo apt-get install ca-certificates + +On macOS, the system curl uses the Keychain trust store; updating macOS itself updates the root certificates. + 2. **On Windows, enable TLS 1.2** in PowerShell before running the installer: + + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 + irm https://claude.ai/install.ps1 | iex + + 3. **Check for proxy or firewall interference** : corporate proxies that perform TLS inspection can cause these errors, including `unable to get local issuer certificate` and `SELF_SIGNED_CERT_IN_CHAIN`. For the install step, point curl at your corporate CA bundle with `--cacert`: + + curl --cacert /path/to/corporate-ca.pem -fsSL https://claude.ai/install.sh | bash + +For Claude Code itself once installed, set `NODE_EXTRA_CA_CERTS` so API requests trust the same bundle: + + export NODE_EXTRA_CA_CERTS=/path/to/corporate-ca.pem + +Ask your IT team for the certificate file if you don’t have it. You can also try on a direct connection to confirm the proxy is the cause. + 4. **On Windows, bypass certificate revocation checks** if you see `CRYPT_E_NO_REVOCATION_CHECK (0x80092012)` or `CRYPT_E_REVOCATION_OFFLINE (0x80092013)`. These mean curl reached the server but your network blocks the certificate revocation lookup, which is common behind corporate firewalls. Add `--ssl-revoke-best-effort` to the install command: + + curl --ssl-revoke-best-effort -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd + +Alternatively, install with `winget install Anthropic.ClaudeCode`, which avoids curl entirely. + +### + +​ + +`Failed to fetch version from downloads.claude.ai` + +The installer couldn’t reach the download server. This typically means `downloads.claude.ai` is blocked on your network. **Solutions:** + + 1. **Test connectivity directly** : + + curl -sI https://downloads.claude.ai/claude-code-releases/latest + + 2. **If behind a proxy** , set `HTTPS_PROXY` so the installer can route through it. See [proxy configuration](</docs/en/network-config#proxy-configuration>) for details. + + export HTTPS_PROXY=http://proxy.example.com:8080 + curl -fsSL https://claude.ai/install.sh | bash + + 3. **If on a restricted network** , try a different network or VPN, or use an alternative install method: On macOS: + + brew install --cask claude-code + +On Windows: + + winget install Anthropic.ClaudeCode + +### + +​ + +Wrong install command on Windows + +If you see `'irm' is not recognized`, `The token '&&' is not valid`, or `'bash' is not recognized as the name of a cmdlet`, you copied the install command for a different shell or operating system. + + * **`irm` not recognized**: you’re in CMD, not PowerShell. You have two options: Open PowerShell by searching for “PowerShell” in the Start menu, then run the original install command: + + irm https://claude.ai/install.ps1 | iex + +Or stay in CMD and use the CMD installer instead: + + curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd + + * **`&&` not valid**: you’re in PowerShell but ran the CMD installer command. Use the PowerShell installer: + + irm https://claude.ai/install.ps1 | iex + + * **`bash` not recognized**: you ran the macOS/Linux installer on Windows. Use the PowerShell installer instead: + + irm https://claude.ai/install.ps1 | iex + +### + +​ + +Install killed on low-memory Linux servers + +If you see `Killed` during installation on a VPS or cloud instance: + + Setting up Claude Code... + Installing Claude Code native build latest... + bash: line 142: 34803 Killed "$binary_path" install ${TARGET:+"$TARGET"} + +The Linux OOM killer terminated the process because the system ran out of memory. Claude Code requires at least 4 GB of available RAM. **Solutions:** + + 1. **Add swap space** if your server has limited RAM. Swap uses disk space as overflow memory, letting the install complete even with low physical RAM. Create a 2 GB swap file and enable it: + + sudo fallocate -l 2G /swapfile + sudo chmod 600 /swapfile + sudo mkswap /swapfile + sudo swapon /swapfile + +Then retry the installation: + + curl -fsSL https://claude.ai/install.sh | bash + + 2. **Close other processes** to free memory before installing. + 3. **Use a larger instance** if possible. Claude Code requires at least 4 GB of RAM. + +### + +​ + +Install hangs in Docker + +When installing Claude Code in a Docker container, installing as root into `/` can cause hangs. **Solutions:** + + 1. **Set a working directory** before running the installer. When run from `/`, the installer scans the entire filesystem, which causes excessive memory usage. Setting `WORKDIR` limits the scan to a small directory: + + WORKDIR /tmp + RUN curl -fsSL https://claude.ai/install.sh | bash + + 2. **Increase Docker memory limits** if using Docker Desktop: + + docker build --memory=4g . + +### + +​ + +Claude Desktop overrides the `claude` command on Windows + +If you installed an older version of Claude Desktop, it may register a `Claude.exe` in the `WindowsApps` directory that takes PATH priority over Claude Code CLI. Running `claude` opens the Desktop app instead of the CLI. Update Claude Desktop to the latest version to fix this issue. + +### + +​ + +Claude Code on Windows requires either Git for Windows (for bash) or PowerShell + +Claude Code on native Windows needs at least one shell: either [Git for Windows](<https://git-scm.com/downloads/win>) for Bash, or PowerShell. When neither is found, this error appears at startup. If only PowerShell is found, Claude Code uses the PowerShell tool instead of Bash. **If neither is installed** , install one: + + * Git for Windows: download from [git-scm.com/downloads/win](<https://git-scm.com/downloads/win>). During setup, select “Add to PATH.” Restart your terminal after installing. + * PowerShell 7: download from [aka.ms/powershell](<https://aka.ms/powershell>). + +**If Git is already installed** but Claude Code can’t find it, set the path in your [settings.json file](</docs/en/settings>): + + { + "env": { + "CLAUDE_CODE_GIT_BASH_PATH": "C:\\Program Files\\Git\\bin\\bash.exe" + } + } + +If your Git is installed somewhere else, find the path by running `where.exe git` in PowerShell and use the `bin\bash.exe` path from that directory. + +### + +​ + +Claude Code does not support 32-bit Windows + +Windows includes two PowerShell entries in the Start menu: `Windows PowerShell` and `Windows PowerShell (x86)`. The x86 entry runs as a 32-bit process and triggers this error even on a 64-bit machine. To check which case you’re in, run this in the same window that produced the error: + + [Environment]::Is64BitOperatingSystem + +If this prints `True`, your operating system is fine. Close the window, open `Windows PowerShell` without the x86 suffix, and run the install command again. If this prints `False`, you are on a 32-bit edition of Windows. Claude Code requires a 64-bit operating system. See the [system requirements](</docs/en/setup#system-requirements>). + +### + +​ + +Linux musl or glibc binary mismatch + +If you see errors about missing shared libraries like `libstdc++.so.6` or `libgcc_s.so.1` after installation, the installer may have downloaded the wrong binary variant for your system. + + Error loading shared library libstdc++.so.6: No such file or directory + +This can happen on glibc-based systems that have musl cross-compilation packages installed, causing the installer to misdetect the system as musl. **Solutions:** + + 1. **Check which libc your system uses** : + + ldd --version 2>&1 | head -1 + +Output mentioning `GNU libc` or `GLIBC` means glibc. Output mentioning `musl` means musl. + 2. **If you’re on glibc but got the musl binary** , remove the installation and reinstall. You can also manually download the correct binary using the manifest at `https://downloads.claude.ai/claude-code-releases/{VERSION}/manifest.json`. File a [GitHub issue](<https://github.com/anthropics/claude-code/issues>) with the output of `ldd --version` and `ls /lib/libc.musl*`. + 3. **If you’re actually on musl** , such as Alpine Linux, install the required packages: + + apk add libgcc libstdc++ ripgrep + +### + +​ + +`Illegal instruction` + +If running `claude` or the installer prints `Illegal instruction`, the native binary uses CPU instructions your processor doesn’t support. There are two distinct causes. **Architecture mismatch.** The installer downloaded the wrong binary, for example x86 on an ARM server. Check with `uname -m` on macOS or Linux, or `$env:PROCESSOR_ARCHITECTURE` in PowerShell. If the result doesn’t match the binary you received, [file a GitHub issue](<https://github.com/anthropics/claude-code/issues>) with the output. **Missing instruction set on older CPUs.** If your architecture is correct but you still see `Illegal instruction`, your CPU likely lacks AVX or another instruction the binary requires. This affects roughly pre-2013 Intel and AMD processors. There is currently no native-binary workaround; track [issue #50384](<https://github.com/anthropics/claude-code/issues/50384>) for status, and include your CPU model from `cat /proc/cpuinfo | grep "model name" | head -1` on Linux or `sysctl -n machdep.cpu.brand_string` on macOS when reporting. Alternative install methods download the same native binary and won’t resolve either cause. + +### + +​ + +`dyld: cannot load` on macOS + +If you see `dyld: cannot load`, `dyld: Symbol not found`, or `Abort trap: 6` during installation, the binary is incompatible with your macOS version or hardware. + + dyld: cannot load 'claude-2.1.42-darwin-x64' (load command 0x80000034 is unknown) + Abort trap: 6 + +A `Symbol not found` error that references `libicucore` also indicates your macOS version is older than the binary supports: + + dyld: Symbol not found: _ubrk_clone + Referenced from: claude-darwin-x64 (which was built for Mac OS X 13.0) + Expected in: /usr/lib/libicucore.A.dylib + +**Solutions:** + + 1. **Check your macOS version** : Claude Code requires macOS 13.0 or later. Open the Apple menu and select About This Mac to check your version. + 2. **Update macOS** if you’re on an older version. The binary uses load commands and system libraries that older macOS versions don’t support. Alternative install methods like Homebrew download the same binary and won’t resolve this error. + +### + +​ + +`Exec format error` on WSL1 + +If running `claude` in WSL prints `cannot execute binary file: Exec format error`, you’re on WSL1 and hitting a known native-binary regression tracked in [issue #38788](<https://github.com/anthropics/claude-code/issues/38788>). The binary’s program headers changed in a way WSL1’s loader can’t handle. The cleanest fix is to convert your distribution to WSL2 from PowerShell: + + wsl --set-version <DistroName> 2 + +If you need to stay on WSL1, invoke the binary through the dynamic linker. Add this function to `~/.bashrc` inside WSL, replacing the path if your home directory differs: + + claude() { + /lib64/ld-linux-x86-64.so.2 "$(readlink -f "$HOME/.local/bin/claude")" "$@" + } + +Then run `source ~/.bashrc` and retry `claude`. + +### + +​ + +npm install errors in WSL + +These issues apply if you installed Claude Code with `npm install -g` inside WSL. If you used the [native installer](</docs/en/setup>), skip this section. **OS or platform detection issues.** If npm reports a platform mismatch during install, WSL is likely picking up the Windows `npm`. Run `npm config set os linux` first, then install with `npm install -g @anthropic-ai/claude-code --force`. Do not use `sudo`. **`exec: node: not found` when running `claude`.** Your WSL environment is likely using the Windows installation of Node.js. Confirm with `which npm` and `which node`: paths starting with `/mnt/c/` are Windows binaries, while Linux paths start with `/usr/`. To fix this, install Node via your Linux distribution’s package manager or via [`nvm`](<https://github.com/nvm-sh/nvm>). **nvm version conflicts.** If you have nvm installed in both WSL and Windows, switching Node versions in WSL may break because WSL imports the Windows PATH by default and the Windows nvm takes priority. The most common cause is that nvm isn’t loaded in your shell. Add the nvm loader to `~/.bashrc` or `~/.zshrc`: + + export NVM_DIR="$HOME/.nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" + [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" + +Or load it in your current session: + + source ~/.nvm/nvm.sh + +If nvm is loaded but Windows paths still take priority, prepend your Linux Node path explicitly: + + export PATH="$HOME/.nvm/versions/node/$(node -v)/bin:$PATH" + +Avoid disabling Windows PATH importing via `appendWindowsPath = false` as this breaks the ability to call Windows executables from WSL. Similarly, avoid uninstalling Node.js from Windows if you use it for Windows development. + +### + +​ + +Permission errors during installation + +If the native installer fails with permission errors, the target directory may not be writable. See Check directory permissions. If you previously installed with npm and are hitting npm-specific permission errors, switch to the native installer: + + curl -fsSL https://claude.ai/install.sh | bash + +### + +​ + +Native binary not found after npm install + +The `@anthropic-ai/claude-code` npm package pulls in the native binary through a per-platform optional dependency such as `@anthropic-ai/claude-code-darwin-arm64`. If running `claude` after install prints `Could not find native binary package "@anthropic-ai/claude-code-<platform>"`, check the following causes: + + * **Optional dependencies are disabled.** Remove `--omit=optional` from your npm install command, `--no-optional` from pnpm, or `--ignore-optional` from yarn, and check that `.npmrc` does not set `optional=false`. Then reinstall. The native binary is delivered only as an optional dependency, so there is no JavaScript fallback if it is skipped. + * **Unsupported platform.** Prebuilt binaries are published for `darwin-arm64`, `darwin-x64`, `linux-x64`, `linux-arm64`, `linux-x64-musl`, `linux-arm64-musl`, `win32-x64`, and `win32-arm64`. Claude Code does not ship a binary for other platforms; see the [system requirements](</docs/en/setup#system-requirements>). + * **Corporate npm mirror is missing the platform packages.** Ensure your registry mirrors all eight `@anthropic-ai/claude-code-*` platform packages in addition to the meta package. + +Installing with `--ignore-scripts` does not trigger this error. The postinstall step that links the binary into place is skipped, so Claude Code falls back to a wrapper that locates and spawns the platform binary on each launch. This works but starts more slowly; reinstall with scripts enabled for direct execution. + +## + +​ + +Login and authentication + +These sections address login failures, OAuth errors, and token issues. + +### + +​ + +Reset your login + +When login fails and the cause isn’t obvious, a clean re-authentication resolves most cases: + + 1. Run `/logout` to sign out completely + 2. Close Claude Code + 3. Restart with `claude` and complete the authentication process again + +If the browser doesn’t open automatically during login, press `c` to copy the OAuth URL to your clipboard, then paste it into a browser manually. This also works when the URL wraps across lines in a narrow or SSH terminal and can’t be clicked directly. + +### + +​ + +OAuth error: Invalid code + +If you see `OAuth error: Invalid code. Please make sure the full code was copied`, the login code expired or was truncated during copy-paste. **Solutions:** + + * Press Enter to retry and complete the login quickly after the browser opens + * Type `c` to copy the full URL if the browser doesn’t open automatically + * If using a remote/SSH session, the browser may open on the wrong machine. Copy the URL displayed in the terminal and open it in your local browser instead. + +### + +​ + +403 Forbidden after login + +If you see `API Error: 403 {"error":{"type":"forbidden","message":"Request not allowed"}}` after logging in: + + * **Claude Pro/Max users** : verify your subscription is active at [claude.ai/settings](<https://claude.ai/settings>) + * **Anthropic Console users** : confirm your account has the “Claude Code” or “Developer” role. Admins assign this in the Anthropic Console under Settings → Members. + * **Behind a proxy** : corporate proxies can interfere with API requests. See [network configuration](</docs/en/network-config>) for proxy setup. + +### + +​ + +This organization has been disabled with an active subscription + +If you see `API Error: 400 ... "This organization has been disabled"` despite having an active Claude subscription, an `ANTHROPIC_API_KEY` environment variable is overriding your subscription. This commonly happens when an old API key from a previous employer or project is still set in your shell profile. When `ANTHROPIC_API_KEY` is present and you have approved it, Claude Code uses that key instead of your subscription’s OAuth credentials. In non-interactive mode with the `-p` flag, the key is always used when present. See [authentication precedence](</docs/en/authentication#authentication-precedence>) for the full resolution order. To use your subscription instead, unset the environment variable and remove it from your shell profile: + + unset ANTHROPIC_API_KEY + claude + +Check `~/.zshrc`, `~/.bashrc`, or `~/.profile` for `export ANTHROPIC_API_KEY=...` lines and remove them to make the change permanent. On Windows, check your PowerShell profile at `$PROFILE` and your User environment variables for `ANTHROPIC_API_KEY`. Run `/status` inside Claude Code to confirm which authentication method is active. + +### + +​ + +OAuth login fails in WSL2 + +Browser-based login in WSL2 can fail in two ways: WSL can’t open your Windows browser, or the terminal won’t accept the pasted authorization code. If the browser doesn’t open, set the `BROWSER` environment variable to your Windows browser path: + + export BROWSER="/mnt/c/Program Files/Google/Chrome/Application/chrome.exe" + claude + +Or press `c` at the login prompt to copy the OAuth URL and paste it into your Windows browser yourself. If the browser opens but pasting the code back into the terminal does nothing, your terminal’s paste binding likely isn’t reaching the prompt. Try your terminal’s alternate paste shortcut, often right-click or Shift+Insert in Windows Terminal, or run login outside the interactive UI: + + claude auth login + +This fallback also applies on native Windows or any terminal where pasting the code into the interactive prompt fails. + +### + +​ + +Not logged in or token expired + +If Claude Code prompts you to log in again after a session, your OAuth token may have expired. Run `/login` to re-authenticate. If this happens frequently, check that your system clock is accurate, as token validation depends on correct timestamps. On macOS, login can also fail when the Keychain is locked or its password is out of sync with your account password, which prevents Claude Code from saving credentials. Run `claude doctor` to check Keychain access. To unlock the Keychain manually, run `security unlock-keychain ~/Library/Keychains/login.keychain-db`. If unlocking doesn’t help, open Keychain Access, select the `login` keychain, and choose Edit > Change Password for Keychain “login” to resync it with your account password. + +### + +​ + +Bedrock, Vertex, or Foundry credentials not loading + +If you configured Claude Code to use a cloud provider and see `Could not load credentials from any providers` on Bedrock, `Could not load the default credentials` on Vertex, or `ChainedTokenCredential authentication failed` on Foundry, your cloud provider CLI is likely not authenticated in the current shell. For Bedrock, confirm your AWS credentials are valid: + + aws sts get-caller-identity + +For Vertex AI, confirm `ANTHROPIC_VERTEX_PROJECT_ID` and `CLOUD_ML_REGION` are set in your shell, then set application default credentials: + + gcloud auth application-default login + +For Microsoft Foundry, confirm `ANTHROPIC_FOUNDRY_API_KEY` is set, or sign in with the Azure CLI so the default credential chain can find your account: + + az login + +If credentials work in your terminal but not in the VS Code or JetBrains extension, the IDE process likely didn’t inherit your shell environment. Set the provider environment variables in the IDE’s own settings, or launch the IDE from a terminal where they’re already exported. See [Amazon Bedrock](</docs/en/amazon-bedrock>), [Google Vertex AI](</docs/en/google-vertex-ai>), or [Microsoft Foundry](</docs/en/microsoft-foundry>) for full provider setup. + +## + +​ + +Still stuck + +If none of the above resolves your issue: + + 1. Check the [GitHub repository](<https://github.com/anthropics/claude-code/issues>) for known issues, or open a new one with your operating system, the install command you ran, and the full error output + 2. If `claude --version` works but something else is wrong, run `claude doctor` for an automated diagnostic report + 3. If you can start a session, use `/feedback` inside Claude Code to report the problem