Skip to content

[Bug]: openclaw update command fails with EBUSY error on Windows #40540

@rainar-sun

Description

@rainar-sun

Bug type

Behavior bug (incorrect output/state without crash)

Summary

Description
Running openclaw update fails with EBUSY error, preventing OpenClaw from updating itself.

Environment
OS: Windows_NT 10.0.20348
Node: v22.22.0
OpenClaw: 2026.3.2

Root Cause Analysis
The openclaw update command attempts to update itself via npm while it is still running. During the update process, npm needs to rename/move the node_modules/openclaw directory, but this directory is locked by the current process, causing Windows to reject the rename operation.

This is a "self-update" design issue: the update process needs to replace the directory it is running from, but the directory is occupied by itself.

Temporary Workaround

  1. Stop Gateway service: openclaw gateway stop
  2. Kill any remaining node processes: taskkill /F /IM node.exe
  3. Manually update: npm install -g openclaw
  4. Restart Gateway: openclaw gateway start

Suggested Fixes

  1. Option A: Spawn a separate child process to execute npm update, rather than running in the current Gateway process
  2. Option B: Download new version to a temp directory first, then switch after update completes (blue-green deployment)
  3. Option C: Prompt user to stop Gateway service before updating

Steps to reproduce

use openclaw update command to upgrade from version 2026.3.2 to v2026.3.7.

Expected behavior

system updated to v2026.3.7.

Actual behavior

Update Result: ERROR
Root: C:\Users\Administrator\AppData\Roaming\npm\node_modules\openclaw
Reason: global update (omit optional)
Before: 2026.3.2
After: 2026.3.2

OpenClaw version

2026.3.2

Operating system

Windows_NT 10.0.20348

Install method

No response

Logs, screenshots, and evidence

Update Result: ERROR
  Root: C:\Users\Administrator\AppData\Roaming\npm\node_modules\openclaw
  Reason: global update (omit optional)
  Before: 2026.3.2
  After: 2026.3.2

Steps:
  ✗ global update (30.42s)
      npm error code EBUSY
      npm error syscall rename
      npm error path C:\Users\Administrator\AppData\Roaming\npm\node_modules\openclaw
      npm error dest C:\Users\Administrator\AppData\Roaming\npm\node_modules\.openclaw-oHGnns6k
      npm error errno -4082

Impact and severity

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingbug:behaviorIncorrect behavior without a crash

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions