DEV Community

Abheesht Tripathi
Abheesht Tripathi

Posted on Originally published at aireviewready.in

'irm' is not recognized: fixing the Claude Code install on Windows

If you pasted the Claude Code install line on Windows and got

'irm' is not recognized as an internal or external command,
operable program or batch file.
Enter fullscreen mode Exit fullscreen mode

the command is fine. It was pasted into the wrong shell.

Why it happens

irm is a PowerShell alias for Invoke-RestMethod. Command Prompt (cmd) has no such command, so it stops at the first word.

Fix 1: run it in PowerShell

Open PowerShell (not Command Prompt) and run:

irm https://claude.ai/install.ps1 | iex
Enter fullscreen mode Exit fullscreen mode

Quick way to tell which shell you are in: a PowerShell prompt starts with PS C:\.... Command Prompt does not.

Fix 2: stay in Command Prompt

Use the CMD installer instead:

curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
Enter fullscreen mode Exit fullscreen mode

Fix 3: call PowerShell from Command Prompt

powershell -NoProfile -Command "irm https://claude.ai/install.ps1 | iex"
Enter fullscreen mode Exit fullscreen mode

A string passed to -Command runs as PowerShell code, so irm works there.

The opposite error

If you pasted the CMD line into Windows PowerShell 5.1, you may see The token '&&' is not a valid statement separator in this version. && between commands only exists in PowerShell 7+. Use Fix 1 in PowerShell, or run the CMD line in Command Prompt.


More Windows install errors for Claude Code (32-bit message, fsSL parameter error, scripts disabled) are collected on the original page linked as canonical.

Top comments (0)