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.
Jump to Solution
What the Error Looks Like
You'll see this error when running npm install in PowerShell:
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
.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.
Fix B: Change the Execution Policy
If you want npm (without .cmd) to work natively in PowerShell, change the execution policy:
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 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
Default on Windows. No .ps1 scripts can run. This is what causes the error.
Local scripts run freely. Downloaded scripts need a digital signature. Best for developers.
All scripts run with a warning for downloaded files. Less secure than RemoteSigned.
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:
# 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
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.
Seeing Other Errors Too?
Windows installation issues often come with these related problems:
Did this guide solve your problem?