Fix OpenClaw npm Install Errors on Windows
This page covers installation errors only. If OpenClaw is installed but the Gateway is crashing or not starting, see Windows Gateway Service Errors.
Installing OpenClaw on Windows can fail at several points — PowerShell execution restrictions, missing Git, EBUSY locks, or the postinstall step crashing with exit code 3221225477. This guide covers every install blocker in order.
Jump to Your Error
Error: PSSecurityException — Script Blocked
npm : File C:\Program Files\nodejs\npm.ps1 cannot be loaded because running scripts is disabled on this system. (PSSecurityException)
Windows PowerShell blocks .ps1 script execution by default. You have two options:
Option A: Use .cmd Shims (Recommended)
No security settings changed. Use .cmd instead of the default .ps1 shims:
Option B: Change Execution Policy
Run PowerShell as Administrator:
Lowers system security. Option A is safer.
For a dedicated guide on this error, see Fix PowerShell Scripts Blocked.
Error: spawn git ENOENT — Git Not Found
Git is required by OpenClaw's postinstall step but isn't installed or isn't in PATH. Fix:
winget install Git.Git # After installation, close and reopen your terminal # PATH won't update until you restart git --version
If winget isn't available, download Git directly from git-scm.com and check "Add Git to PATH" during installation.
Error: EBUSY — Resource Locked During Update
The node_modules folder is locked by a running process. To fix:
- Stop the Gateway:
openclaw gateway stop - Close all terminals that are open in the OpenClaw directory
- Close VS Code or any editor with the folder open
- Retry:
npm.cmd install -g openclaw@latest
If it still fails, open Task Manager, find any node.exe processes, and end them manually before retrying.
Error: exit code 3221225477 / Postinstall Crash
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node ./dist/cli/cli.js postinstall npm error Exit code: 3221225477
Exit code 3221225477 (0xC0000005) is a Windows access violation. The postinstall script crashed — usually because:
Antivirus blocking Node.js
Windows Defender or third-party AV is blocking the postinstall script. Temporarily disable real-time protection, install, then re-enable.
Insufficient permissions
Run your terminal as Administrator. Right-click PowerShell or Command Prompt → "Run as administrator", then retry the install.
Corrupted Node.js install
The node.exe binary itself is corrupted. Reinstall Node.js LTS from nodejs.org.
DEP (Data Execution Prevention)
Windows DEP is blocking the script. This is rare but try running from a standard Command Prompt (not PowerShell).
# Run this in Command Prompt as Administrator (not PowerShell) npm install -g openclaw # If that fails, try clearing the npm cache first npm cache clean --force npm install -g openclaw
Warning: CRITICAL — Config Writable by Other Users
[CRITICAL] openclaw.json is writable by other users/groups [CRITICAL] credentials directory is writable by other users/groups
OpenClaw's security audit found that other Windows users can read or modify your config and API keys. Fix with icacls (run as Administrator):
# Lock down the config file icacls "%USERPROFILE%\.openclaw\openclaw.json" /inheritance:r /grant:r "%USERNAME%:(R,W)" /grant:r "SYSTEM:(R,W)" # Lock down the credentials directory icacls "%USERPROFILE%\.openclaw\credentials" /inheritance:r /grant:r "%USERNAME%:(OI)(CI)(R,W)" /grant:r "SYSTEM:(OI)(CI)(R,W)"
This restricts access to your user account and SYSTEM only. Other users on the machine can no longer read your API keys.
Verify the Install Succeeded
# Check openclaw version openclaw --version # Check gateway status openclaw gateway status # Run diagnostics npx clawkit-doctor@latest
Install worked — now Gateway won't start?
After a successful install, these are the most common runtime problems:
Fix It Faster With Our Tools
Did this guide solve your problem?