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?

WindowsにClaudeCodeCLIをインストールする

0
Posted at

PCを変えたため、再度入れ直し。
メモとして残しておきます。

Node.jsインストール

公式からインストーラーをダウンロードし、インストール

nomを使るようにする

PowerShellを管理者モードで開く
まずはNode.jsがインストールされたか確認。

node -v

次にnmpを動かせるようにする

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

なぜこれが必要だったのか?

Node.js(npm)をインストールすると、内部的に .ps1 という拡張子のスクリプトファイルを動かしてコマンドを実行しようとします。

デフォルトのWindowsでは「外部で作られたスクリプトは一切実行させない!」という鉄壁の守り(Restricted という設定)になっているため、たとえ公式の npm であっても実行を拒否されてしまいます。

今回のコマンドを打つことで、「自分でインストールした信頼できるツール(npmなど)なら動かしてもいいよ」と許可を出したことになります。

nmpが使用できるようになったことを確認。

npm -v

ClaudeCodeCLIインストール

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

ClaudeCodeを動かしたいディレクトリへ移動し起動

cd 
claude

この画像が出ればOK!!
image.png

自分の契約形態を選択

image.png

契約済みであれば一番上を押下すると
image.png

ここまでくればOK
image.png

image.png

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?