0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【WSL2版】Claude CodeをWindowsで始める方法

Last updated at Posted at 2025-08-21

2025/08/21現在、Claude Codeはネイティブでwindowsに対応しています

......が、あえて以前のバージョンを使わざるを得ない場面があると思うので、WSLでの環境構築方法も載せておきます。

(「あえて以前のバージョンを使わざるを得ない場面」の参考:)

1.PowerShellを開いて以下のコマンドを叩く

wsl --install -d Ubuntu-22.04
# ここで、インストールが終わったら名前とパスワードを入力する

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs build-essential
node -v     # v22.x が表示されれば OK

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
exec $SHELL

nvm install 22
nvm use 22
nvm alias default 22

npm install @anthropic-ai/claude-code@1.0.24 -g  # 例)v1.0.24のインストール
claude config set -g autoUpdaterStatus disabled

claude  # claude起動

もしここで、

╭──────────────────────────╮
│ ✻ Welcome to Claude Code │
╰──────────────────────────╯

 Unable to connect to Anthropic services

 Failed to connect to api.anthropic.com: ETIMEDOUT

 Please check your internet connection and network settings.

 Note: Claude Code might not be available in your country. Check supported countries at https://anthropic.com/supported-countries

となった場合、Anthropic側のテレメトリ(statsig.anthropic.comなど)とのTLSハンドシェイク失敗が原因なので、以下のようにして起動します。

DISABLE_TELEMETRY=1 claude

2. VSCodeでclaudeを使う

VSCodeにWSL拡張機能をいれます。

画像

Ctrl+Shift+PでWSLと入力し、「Reopen Folder in WSL」を選択すればよいです。

おわり!


ちなみに

こちらの公式ページが参考になります(最近(2025/08/22現在)はネイティブインストールが良さそうみたいな情報もありますね)

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?