Skip to content

Windows: openclaw plugins install fails with spawn EINVAL #7631

@kuman62

Description

@kuman62

Summary

On Windows, openclaw plugins install fails with Error: spawn EINVAL when installing plugins from npm.
The failure happens during the plugin installation step where OpenClaw spawns npm (or npm.cmd) as a child process.

This appears to be a Windows-specific issue related to how child_process.spawn is used for .cmd executables.


Steps to reproduce

  1. Use Windows 10/11.

  2. Install Node.js v22.x LTS.

  3. Install OpenClaw globally:

    npm install -g openclaw
  4. Run the following command in a normal working directory (not System32):

    openclaw plugins install @m1heng-clawd/feishu

Expected behavior

The plugin should be downloaded and installed successfully via npm, and then appear in:

openclaw plugins list

Actual behavior

The command fails immediately with the following error:

Downloading @m1heng-clawd/feishu…
[openclaw] Failed to start CLI: Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:420:11)
    at spawn (node:child_process:787:9)
    at runCommandWithTimeout (.../openclaw/dist/process/exec.js:83:19)
    at installPluginFromNpmSpec (.../openclaw/dist/plugins/install.js:306:23)

The error occurs before npm actually runs.


Environment

  • Clawdbot version: OpenClaw 2026.2.1
  • OS: Windows 11 x64
  • Install method (pnpm/npx/docker/etc): npm install -g openclaw
  • Node.js version: v22.22.0 LTS

Logs or screenshots

Relevant stack trace:

Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:420:11)
    at spawn (node:child_process:787:9)
    at runCommandWithTimeout (openclaw/dist/process/exec.js:83:19)

Additional technical notes

From inspecting dist/process/exec.js, OpenClaw currently spawns npm like this on Windows:

spawn("npm.cmd", args, {
  stdio,
  cwd,
  env,
});

On Windows, spawning .cmd files with shell: false can cause EINVAL.
A possible fix would be to enable shell: true on Windows only, for example:

const isWindows = process.platform === "win32";

spawn(command, args, {
  stdio,
  cwd,
  env,
  shell: isWindows,
});

This approach is commonly used by other cross-platform CLIs to ensure compatibility with Windows command wrappers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    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