The error
npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system.
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
The same error names claude.ps1 when you run claude after an npm install.
Fix 1: allow local scripts for your user
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Then retry. This changes the policy for your Windows user only, not the whole machine.
Fix 2: call the .cmd launcher instead
npm.cmd and claude.cmd do the same job, and the execution policy does not cover them.
Fix 3: use the native installer, not npm
The PowerShell installer installs a program, not a .ps1 script, so the policy does not affect it:
irm https://claude.ai/install.ps1 | iex
It also updates itself. If you switch, remove the npm copy (npm uninstall -g @anthropic-ai/claude-code) so two installs don't compete on PATH.
Other Claude Code install errors on Windows
- Full guide: install Claude Code on Windows
- 'irm' is not recognized / The token '&&' is not a valid statement separator
- 'claude' is not recognized after install or after an update
- requires either Git for Windows (for bash) or PowerShell
- < was unexpected at this time, System.Xml.XmlDocument, or 403 during install
Source: Anthropic's Claude Code docs, Advanced setup and Troubleshoot installation and login, read 28 Nov 2026. Claude Code updates often: if a step here no longer matches, the official docs win.