AI Review Ready
Home / Claude Code / running scripts is disabled
Fix · Claude Code · npm · Windows

running scripts is disabled on this system: Claude Code on Windows

This PowerShell error appears when you install or run Claude Code through npm. PowerShell's execution policy is blocking the small .ps1 launcher files npm creates. Claude Code itself is fine.

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

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.