Dev.to AI πŸ€– Ai πŸ‘ 2 πŸ“– 1 min read

'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. the command is fine. It was pasted into the wrong shell.

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.

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

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

Fix 3: call PowerShell from Command Prompt

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

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.

πŸ“° Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.