ClawKit Logo
ClawKitReliability Toolkit

Fix PowerShell "Scripts Disabled" Error

#1 Windows Installation Blocker

This is the most common error Windows users hit when installing OpenClaw. It's not a bug — Windows PowerShell blocks .ps1 script files by default. There's a zero-config fix.

When you run npm install in PowerShell, npm tries to execute npm.ps1 — a PowerShell wrapper script. Windows blocks it because the default Execution Policy is Restricted, which prevents all .ps1 scripts from running.

What the Error Looks Like

You'll see this error when running npm install in PowerShell:

npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system.
CategoryInfo : SecurityError: (:) [], PSSecurityException
FullyQualifiedErrorId : UnauthorizedAccess

The key part is PSSecurityException — PowerShell is refusing to run the npm.ps1 script because the Execution Policy is set to Restricted.

Fix A: Use npm.cmd Instead (Recommended)

Zero-Config Fix — No Security Changes Needed

# Instead of "npm", use "npm.cmd"
npm.cmd install -g openclaw
# Same for running openclaw
openclaw.cmd gateway start

.cmd files bypass the PowerShell execution policy entirely. This is the safest option — no system configuration changes required.

This works because npm.cmd is a Windows batch file (not a PowerShell script), and batch files are never blocked by the Execution Policy.

npm.cmd→ Windows batch file → always works
npm.ps1→ PowerShell script → blocked by default
npm→ PowerShell auto-prefers .ps1 over .cmd → gets blocked

Fix B: Change the Execution Policy

If you want npm (without .cmd) to work natively in PowerShell, change the execution policy:

PowerShell
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser

This allows locally-created scripts to run while still blocking scripts downloaded from the internet that aren't digitally signed. It only affects your user account, not the entire system.

Verify & Install
# Verify the change
Get-ExecutionPolicy -List

# You should see:
#   CurrentUser    RemoteSigned

# Now npm works without .cmd
npm install -g openclaw

Don't Use Unrestricted

Some guides recommend Set-ExecutionPolicy Unrestricted. This is unnecessary and less secure. RemoteSigned is sufficient and is Microsoft's recommended setting for developers.

Understanding Execution Policies

Restricted

Default on Windows. No .ps1 scripts can run. This is what causes the error.

RemoteSigned

Local scripts run freely. Downloaded scripts need a digital signature. Best for developers.

Unrestricted

All scripts run with a warning for downloaded files. Less secure than RemoteSigned.

Bypass

No restrictions at all. Only use for automated scripts in controlled environments.

Company / Enterprise PCs

On managed corporate machines, the Execution Policy is often controlled by Group Policy (GPO), and you can't change it. In this case:

Use npm.cmd (always works)

The .cmd workaround bypasses PowerShell entirely. This works even with strict GPO policies.

Use Command Prompt (cmd.exe)

Open Command Prompt instead of PowerShell. cmd.exe doesn't have execution policies — all commands work normally.

Ask your IT admin

Request RemoteSigned policy for your user account. Most IT teams will approve this as it's Microsoft's recommended developer setting.

Alternative: Use Command Prompt

If you don't want to deal with PowerShell at all, use Command Prompt (cmd.exe) instead:

Command Prompt
# Press Win+R, type "cmd", press Enter
# Or search for "Command Prompt" in Start Menu

# Then run normally (no .cmd suffix needed)
npm install -g openclaw
openclaw gateway start

Command Prompt doesn't have execution policies. The npm command runs the .cmd version automatically in cmd.exe.

Still Stuck?

Run the Doctor

# Use .cmd suffix to avoid the same error!
npx.cmd clawkit-doctor@latest

The Doctor checks your entire environment and reports exactly what needs fixing.

Or use the web-based Error Doctor to paste the full error and get matched fixes instantly.

Did this guide solve your problem?

Need Help?

Try our automated tools to solve common issues instantly.