Fix 'Failed to start CLI: Error: spawn npm ENOENT' on Windows
Can't install plugins on Windows? Here is the manual fix and the Node LTS solution.
Fix "spawn npm ENOENT" on Windows
Error Confirmation
Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
Scope: This error occurs when OpenClaw attempts to install plugins on Windows. The child process spawn fails because Windows cannot locate npm.exe.
Error Code: ENOENT = "Error NO ENTry" ā the Windows process loader searched the current directory, system directories, and PATH, but did not find the executable.
Verified Environment
| Component | Version | Last Verified |
|---|---|---|
| Operating System | Windows 10/11 | 2026-02-04 |
| Node.js | 18.x LTS, 20.x LTS | 2026-02-04 |
| OpenClaw | Latest stable | 2026-02-04 |
| Shell | PowerShell 7+, CMD | 2026-02-04 |
Note: This issue is specific to Windows process spawning behavior. Linux/macOS do not exhibit this failure mode.
3-Minute Sanity Check
Run these commands in the same terminal where you launch OpenClaw:
# 1. Is Node installed?
node --version
# Expected: v18.x.x or v20.x.x
# 2. Is npm accessible in THIS shell?
npm --version
# Expected: A version number
# 3. Where does Windows think npm is?
where npm
# Expected: A path like C:\Program Files\nodejs\npm.cmd
# 4. Is Node.js in your PATH?
$env:PATH -split ';' | Select-String nodejs
# Expected: At least one match
If any of these fail: Do not proceed. Your environment is missing Node.js or npm is not in PATH. Install Node.js LTS from nodejs.org first.
Decision Gate
Stop fighting VRAM physics.
Should you keep fixing this locally?
Continue local debugging only if:
Stop here if any apply:
Past this point, debugging cost usually grows faster than results.
Primary Exit Path: WSL2
Install Windows Subsystem for Linux and run OpenClaw in a native Linux environment.
Why this works:
- Linux has consistent PATH inheritance between shell and subprocess
- No
.cmdwrapper issues - Node.js behavior matches upstream expectations
Time investment: 20-30 minutes
Steps:
# 1. Install WSL2
wsl --install
# 2. Reboot when prompted
# 3. In WSL2 terminal, install Node.js 20 LTS
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
nvm install 20
nvm use 20
# 4. Install OpenClaw in WSL2
# (Follow standard Linux instructions)
Verification:
# In WSL2 terminal
node --version # Should show v20.x.x
npm --version
which npm # Should show /home/.../.nvm/versions/node/...
Secondary Exit Path (Conditional)
Use a remote Linux environment when:
- WSL2 is blocked by organizational policy
- You need GPU resources beyond what local hardware provides
- You want to avoid any local environment modifications
Solution: Remote Linux VPS
Deploy to a cloud provider and access via SSH. This eliminates Windows-specific environment issues entirely.
Time investment: 15-20 minutes
Steps:
# 1. Provision a Linux VPS (Ubuntu 22.04 recommended)
# 2. SSH into the server
ssh user@your-server-ip
# 3. Install Node.js 20 LTS
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
source ~/.bashrc
nvm install 20
nvm use 20
# 4. Install OpenClaw
npm install -g @m1heng/openclaw
Why NOT Other Options
| Option | Rejection Reason |
|---|---|
| Modify PATH manually | Does not persist for subprocess environments; IDEs and terminals inject different PATHs |
| Use nvm-windows | Adds another layer of PATH indirection; introduces race conditions with system installers |
| Reinstall Node.js | The installer correctly adds to PATH, but subprocess environments are sanitized by Windows |
| Switch to PowerShell 7 | Does not solve the subprocess environment inheritance issue |
| Copy npm.cmd to System32 | Fragile; breaks when Node updates; bypasses package manager entirely |
Use npm.cmd explicitly | Requires modifying OpenClaw source code; not maintainable |
Last Resort: Native Windows Debugging
Warning: This section is provided for documentation purposes only. If you have exhausted WSL2 and remote options and must use native Windows, proceed with caution.
Prerequisite: Only attempt this if:
- Your organization prohibits WSL2 and external environments
- You have explicit approval to modify system-level configurations
Step 1: Confirm Node.js LTS
node --version
If you see v21, v22, or v24: uninstall and install LTS from nodejs.org.
Step 2: Add Node.js to System PATH
- Press
Win + R, typesysdm.cpl, Enter - Advanced tab ā Environment Variables
- Under System variables (not User variables), find
Path - Click Edit ā New
- Add:
C:\Program Files\nodejs - Click OK on all dialogs
- Restart your terminal completely
Step 3: Verify subprocess environment
# Open a FRESH PowerShell (not the one you were using)
node -e "console.log(process.env.PATH.split(';').find(p => p.includes('nodejs')))"
If this returns undefined, the PATH change did not propagate. Reboot your machine.
Step 4: Re-run OpenClaw installer
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\install.ps1
Summary
| Check | Command | Pass Criteria |
|---|---|---|
| Node version | node --version | v18.x or v20.x |
| npm in shell | npm --version | Returns version |
| npm on disk | where npm | Returns path |
| npm in subprocess | node -e "console.log(process.env.PATH)" | Contains nodejs path |
Decision:
- All pass: Your environment is correct. The issue may be OpenClaw-specific. Report the bug with your diagnostic output.
- Any fail: Use WSL2 or consult your system administrator.
Last resort: If you have spent more than 1 hour on this, stop debugging Windows internals. Use WSL2 or a remote Linux environment. The expected time investment for WSL2 is 20 minutes; continued debugging has unbounded time cost.
Bookmark this site
New fixes are added as soon as they appear on GitHub Issues.
Browse Error Index ā