canonical_url: https://yycode.net/docs/ja/nodejs-setup
lang: ja
updated_at: 2026-07-04T13:33:48.616Z
source_html: https://yycode.net/docs/ja/nodejs-setup

# Node.js 環境インストールガイド

Claude Code、Gemini CLI、Codex などのツールはいずれも Node.js 実行環境に依存しています。先にこの手順を完了してください。

## Windows

- **方法 1：公式ダウンロード（推奨）**
  [Node.js 公式サイト](https://nodejs.org/zh-cn/download/) にアクセスして LTS 版をダウンロードし、インストーラーをダブルクリックして案内に従いインストールします。
- ![](https://r2.bozhouai.com/dragoncode/file-20260317105358821.png)
ダウンロード後は、インストール完了まで「次へ」を押し続けます。

- **方法 2：Chocolatey を使用**
  ```bash
  choco install nodejs-lts
  ```
- **方法 3：Scoop を使用**
  ```bash
  scoop install nodejs-lts
  ```

## macOS

- **方法 1：Homebrew を使用（推奨）**
  ```bash
  brew install node
  ```
- **方法 2：公式ダウンロード**
  [Node.js 公式サイト](https://nodejs.org/zh-cn/download/) にアクセスして macOS インストーラーをダウンロードします。

## Linux

- **Ubuntu / Debian**
  ```bash
  curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
  sudo apt-get install -y nodejs
  ```
- **CentOS / RHEL**
  ```bash
  curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash -
  sudo yum install -y nodejs
  ```

## インストール確認

```bash
node --version
npm --version
```

どちらのコマンドもバージョン番号を出力すれば、インストール成功です。

## npm ミラーソースの切り替え（プロキシなし環境）

依存関係のインストールが遅い、またはタイムアウトする場合は、次のコマンドを実行して中国国内ミラーに切り替えます。

```bash
npm config set registry https://registry.npmmirror.com
```

切り替えが成功したか確認します。

```bash
npm config get registry
```

`https://registry.npmmirror.com` と出力されれば有効です。
