1
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?

【Chromebook】Crostini(Linux環境)に nvm ・ Claude Code ・ Claude Code Router (CCR) を一挙導入する手順

1
Posted at

【Chromebook】Crostini(Linux環境)に nvm ・ Claude Code ・ Claude Code Router (CCR) を一挙導入する手順

ChromebookのLinux環境(Crostini)において、Node.jsのバージョン管理ツールである nvm と、AIエージェントツール Claude Code、そしてAPIルーティングを最適化する Claude Code Router (CCR) をインストールしたときの手順を備忘録としてまとめました。
さくらのAI エンジンで動作確認できました。

この記事のポイント

  • 対象環境: ChromebookのLinux開発環境(Crostini)
  • Node.js環境: システム標準ではなく nvm を使ってLTS版を管理
  • 導入の流し: nvm 導入 ➔ LTS版Node.js導入 ➔ ccr インストール ➔ claude-code インストール

検証環境

user@penguin:~$ uname -a
Linux penguin 6.6.147-09648-g97ef00d8a343 #1 SMP PREEMPT_DYNAMIC Wed, 16 Sep 2026 19:33:09 -0700 x86_64 GNU/Linux


1. nvm(Node Version Manager)のインストール

公式のインストールスクリプトを実行して nvm を導入します。

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

実行時の出力例:

=> Downloading nvm as script to '/home/user/.config/nvm'
=> Appending nvm source string to /home/user/.bashrc
=> Appending bash_completion source string to /home/user/.bashrc

インストール後、指示に従って環境変数を反映させます。

export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

正しくインストールされたかバージョンを確認します。

user@penguin:~$ nvm --version
0.39.7


2. Node.js(LTS版)のインストール

nvm を使って推奨される最新のLTS版Node.jsをインストールし、デフォルトとして有効化します。

# LTS版のインストール(自動でnodeおよびnpmが導入されます)
nvm install --lts

# 使用するバージョンをLTSに切り替え
nvm use --lts

実行時の出力例:

Installing latest LTS version.
Downloading and installing node v26.13.1...
Downloading https://nodejs.org/dist/v26.13.1/node-v26.13.1-linux-x64.tar.xz...
########################################################################## 100.0%
Computing checksum with sha256sum
Checksums matched!
Now using node v26.13.1 (npm v11.20.0)
Creating default alias: default -> lts/* (-> v26.13.1)


3. Claude Code Router (CCR) のインストール

次に、APIコストの削減や別モデルへのルーティングを行える Claude Code Router (CCR) をグローバルインストールします。

npm install -g @musistudio/claude-code-router

実行時の出力と注意点:

npm warn deprecated prebuild-install@7.1.3: No longer maintained. Please contact the author of the relevant native addon; alternatives are available.
added 101 packages in 30s
npm warn install-scripts 1 package has install scripts not yet covered by allowScripts:
npm warn install-scripts   better-sqlite3@12.11.1 (install: prebuild-install || node-gyp rebuild --release)

💡 補足: prebuild-install に関する警告が出ますが、依存パッケージ側の仕様によるものなのでインストール自体は正常に完了しています。

ここで、設定ファイル未作成の状態で ccr --version を実行すると以下のメッセージが出ます。

user@penguin:~$ ccr --version
No available models. Configure at least one provider with a model before starting CCR Gateway or opening an agent through CCR.

※このエラーは、まだプロバイダー(GeminiやDeepSeekなど)の設定が ~/.claude-code-router/config.json に記述されていないためです。後ほど設定ファイルを作成することで解消されます。


4. Claude Code のインストール

最後に、公式の Claude Code をインストールします。

npm install -g @anthropic-ai/claude-code

実行時の出力例:

added 2 packages in 37s
npm warn install-scripts 1 package has install scripts not yet covered by allowScripts:
npm warn install-scripts   @anthropic-ai/claude-code@2.1.325 (postinstall: node install.cjs)


まとめ

これで、ChromebookのCrostini環境に nvm、Node.js、Claude Code、そして CCR の一連の開発ツール群の導入が完了しました。
ccr uiでCCRの設定ファイル (~/.claude-code-router/config.json) にAPIキーや利用するモデルを記述すれば、すぐに開発をスタートできます。

1
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
1
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?