WSL 通过官方命令安装 Claude Code 失败的解决方案

Claude Code Docs curl -fsSL https://claude.ai/install.sh | bash - Quickstart - Claude Code Docs Be specific with your requests | Welcome to Claude Cod...
WSL 通过官方命令安装 Claude Code 失败的解决方案
WSL 通过官方命令安装 Claude Code 失败的解决方案
Claude Code Docs

curl -fsSL https://claude.ai/install.sh | bash - Quickstart - Claude Code Docs

Be specific with your requests | Welcome to Claude Code!

使用:curl -fsSL https://claude.ai/install.sh | bash 这个命令安装 Claude Code, 如果代理不纯净的话,会被Cloudflare卡住; 解决方法是使用 npm 命令安装

forbackup@LAPTOP-XCG:~$ curl -fsSL https://claude.ai/install.sh | bash
^C
forbackup@LAPTOP-XCG:~$ curl -I https://claude.ai
HTTP/1.1 200 Connection established

HTTP/2 103
link: <https://assets-proxy.anthropic.com>; crossorigin; rel=preconnect, <https://assets-proxy.anthropic.com/claude-ai/v2/assets/v1/index-ChAZ9yKa.js>; as=script; crossorigin; rel=preload, <https://assets-proxy.anthropic.com/claude-ai/v2/assets/v1/cc8728789-D_SWcLm6.css>; as=style; crossorigin; rel=preload, <https://assets-proxy.anthropic.com/claude-ai/v2/assets/v1/c5f4e1303-o73uZ2YJ.css>; as=style; crossorigin; rel=preload, <https://assets-proxy.anthropic.com/claude-ai/v2/assets/v1/c6a992d55-CvacvKTI.css>; as=style; crossorigin; rel=preload, <https://assets-proxy.anthropic.com/claude-ai/v2/assets/v1/cc27851ad-CFxw3nG7.woff2>; as=font; crossorigin; rel=preload; type=font/woff2, <https://assets-proxy.anthropic.com/claude-ai/v2/assets/v1/c66fc489e-C-BHYa_K.woff2>; as=font; crossorigin; rel=preload; type=font/woff2

HTTP/2 403
date: Thu, 04 Jun 2026 14:21:52 GMT
content-type: text/html; charset=UTF-8
content-length: 5336
accept-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
cf-mitigated: challenge
content-security-policy: default-src 'none'; script-src 'nonce-4p8413tCo4SRbicoABpLGT' 'unsafe-eval' https://challenges.cloudflare.com; script-src-attr 'none'; style-src 'unsafe-inline'; img-src 'self' https://challenges.cloudflare.com; connect-src 'self' https://challenges.cloudflare.com; frame-src 'self' https://challenges.cloudflare.com blob:; child-src 'self' https://challenges.cloudflare.com blob:; worker-src blob:; form-action http: https:; base-uri 'self'
server: cloudflare
critical-ch: Sec-CH-UA-Bitness, Sec-CH-UA-Arch, Sec-CH-UA-Full-Version, Sec-CH-UA-Mobile, Sec-CH-UA-Model, Sec-CH-UA-Platform-Version, Sec-CH-UA-Full-Version-List, Sec-CH-UA-Platform, Sec-CH-UA, UA-Bitness, UA-Arch, UA-Full-Version, UA-Mobile, UA-Model, UA-Platform-Version, UA-Platform, UA
cross-origin-embedder-policy: require-corp
cross-origin-opener-policy: same-origin
cross-origin-resource-policy: same-origin
origin-agent-cluster: ?1
permissions-policy: accelerometer=(),camera=(),clipboard-read=(),clipboard-write=(),geolocation=(),gyroscope=(),hid=(),magnetometer=(),microphone=(),payment=(),publickey-credentials-get=(),screen-wake-lock=(),serial=(),sync-xhr=(),usb=(),xr-spatial-tracking=*
referrer-policy: same-origin
server-timing: chlray;desc="a06796223c764fb1"
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
set-cookie: __cf_bm=qZWjNAtZJorhWKB2N6GOmpWUL4BLHcTuOW46vnyUM5s-1780582912.3516824-1.0.1.1-TCDOCeFzcCVuKM8d4.4u.iPEXkHZItRZo2UqLFPU0CopJ3ppR__Lnyik2zlMrSIvxrbX84XcmGYa3J45_sODiTnSzIKbxRin3irOmU0WJ4QCKKw2aYmgoe_6mMGSNUxG; HttpOnly; SameSite=None; Secure; Path=/; Domain=claude.ai; Expires=Thu, 04 Jun 2026 14:51:52 GMT
cf-ray: a06796223c764fb1-LAX
alt-svc: h3=":443"; ma=86400

forbackup@LAPTOP-XCG:~$ node -v
v22.22.3
forbackup@LAPTOP-XCG:~$ npm install -g @anthropic-ai/claude-code

added 2 packages in 2m
forbackup@LAPTOP-XCG:~$
claude --version
2.1.141 (Claude Code)
forbackup@LAPTOP-XCG:~$

5 个帖子 - 2 位参与者

阅读完整话题

来源: LinuxDo 最新话题查看原文