openclaw - 💡(How to fix) Fix [Bug]: CLI fails to start: Cannot find module 'openclaw.mjs' after global npm install leaves package directory empty [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#77788Fetched 2026-05-06 06:21:26
View on GitHub
Comments
1
Participants
2
Timeline
6
Reactions
2
Timeline (top)
subscribed ×3labeled ×2commented ×1

After npm install -g [email protected] on Windows, the global package directory is missing openclaw.mjs and all source files, so the openclaw launcher exits immediately with MODULE_NOT_FOUND.

Error Message

Launcher (C:\Users\Zalex\AppData\Roaming\npm\openclaw.cmd, line 17):

endLocal & goto #undefined# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\node_modules\openclaw\openclaw.mjs" %* Directory contents of C:\Users\Zalex\AppData\Roaming\npm\node_modules\openclaw\ (ls -la):

drwxr-xr-x 1 Zalex 197121 0 May 5 11:38 . drwxr-xr-x 1 Zalex 197121 0 May 5 11:38 .. drwxr-xr-x 1 Zalex 197121 0 May 5 11:38 node_modules Nested contents — only one transitive dep was extracted:

node_modules@mariozechner\clipboard-win32-x64-msvc Full runtime error: see Actual behavior above.

Root Cause

After npm install -g [email protected] on Windows, the global package directory is missing openclaw.mjs and all source files, so the openclaw launcher exits immediately with MODULE_NOT_FOUND.

Fix Action

Fix / Workaround

2026.5.4 (resolved by npm view openclaw version)

Code Example

Launcher (C:\Users\Zalex\AppData\Roaming\npm\openclaw.cmd, line 17):

endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\node_modules\openclaw\openclaw.mjs" %*
Directory contents of C:\Users\Zalex\AppData\Roaming\npm\node_modules\openclaw\ (ls -la):

drwxr-xr-x 1 Zalex 197121 0 May  5 11:38 .
drwxr-xr-x 1 Zalex 197121 0 May  5 11:38 ..
drwxr-xr-x 1 Zalex 197121 0 May  5 11:38 node_modules
Nested contents — only one transitive dep was extracted:

node_modules\@mariozechner\clipboard-win32-x64-msvc
Full runtime error: see Actual behavior above.
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

After npm install -g [email protected] on Windows, the global package directory is missing openclaw.mjs and all source files, so the openclaw launcher exits immediately with MODULE_NOT_FOUND.

Steps to reproduce

On Windows 11 with Node.js v24.14.0 and npm prefix C:\Users\Zalex\AppData\Roaming\npm, install the package globally: npm install -g openclaw (resolved version [email protected]). From any shell, run openclaw.

Expected behavior

The openclaw binary starts the CLI. The shim C:\Users\Zalex\AppData\Roaming\npm\openclaw.cmd (line 17) invokes node "%dp0%\node_modules\openclaw\openclaw.mjs", so a correctly installed package must contain openclaw.mjs at C:\Users\Zalex\AppData\Roaming\npm\node_modules\openclaw\openclaw.mjs. The npm registry metadata for [email protected] declares bin: openclaw with an unpacked size of 74.5 MB, confirming the entry file is expected to be present after install

Actual behavior

Running openclaw produces:

node:internal/modules/cjs/loader:1459 throw err; ^ Error: Cannot find module 'C:\Users\Zalex\AppData\Roaming\npm\node_modules\openclaw\openclaw.mjs' at Module._resolveFilename (node:internal/modules/cjs/loader:1456:15) ... code: 'MODULE_NOT_FOUND', requireStack: [] } Node.js v24.14.0 Listing the install directory shows that C:\Users\Zalex\AppData\Roaming\npm\node_modules\openclaw\ contains only a single nested entry node_modules@mariozechner\clipboard-win32-x64-msvc. No openclaw.mjs, no package.json, and none of the 58 declared dependencies are present at the top level of the package.

Directory timestamp on the broken install: May 5 11:38 (2026-05-05).

OpenClaw version

2026.5.4 (resolved by npm view openclaw version)

Operating system

Windows 11 Home, build 10.0.26200

Install method

default

Model

Deepseek

Provider / routing chain

opencode

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Launcher (C:\Users\Zalex\AppData\Roaming\npm\openclaw.cmd, line 17):

endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\node_modules\openclaw\openclaw.mjs" %*
Directory contents of C:\Users\Zalex\AppData\Roaming\npm\node_modules\openclaw\ (ls -la):

drwxr-xr-x 1 Zalex 197121 0 May  5 11:38 .
drwxr-xr-x 1 Zalex 197121 0 May  5 11:38 ..
drwxr-xr-x 1 Zalex 197121 0 May  5 11:38 node_modules
Nested contents — only one transitive dep was extracted:

node_modules\@mariozechner\clipboard-win32-x64-msvc
Full runtime error: see Actual behavior above.

Impact and severity

Affected users/systems: Any Windows user who ends up with this partial install state on [email protected] via global npm install. Severity: Blocks workflow — the CLI cannot start at all; user-level config in C:\Users\Zalex.openclaw\ is intact but unreachable through the binary. Frequency: NOT_ENOUGH_INFO (observed once on this machine; reproducibility across environments not established from the available evidence). Consequence: openclaw is unusable until the package is reinstalled.

Additional information

The launcher openclaw.cmd and its sibling openclaw / openclaw.ps1 shims are correct and unchanged; the failure is entirely on the package payload side. The user-config tree at C:\Users\Zalex.openclaw\ (openclaw.json, agents/, memory/, plugins/, etc.) is unaffected. Last-known-good and first-known-bad versions: NOT_ENOUGH_INFO.

extent analysis

TL;DR

The issue can be resolved by reinstalling the openclaw package using npm install -g [email protected] with additional flags to force a complete reinstall.

Guidance

  • Verify the package directory C:\Users\Zalex\AppData\Roaming\npm\node_modules\openclaw is empty or missing expected files before attempting a reinstall.
  • Use npm uninstall -g openclaw to completely remove the package before reinstalling to ensure a clean install.
  • Consider using npm install -g [email protected] --force to force a complete reinstall of the package and its dependencies.
  • After reinstalling, verify the presence of openclaw.mjs and other expected files in the package directory.

Example

No code snippet is provided as the issue is related to package installation and not code-specific.

Notes

The root cause of the issue is unclear, but it appears to be related to a partial or corrupted package installation. Reinstalling the package with additional flags to force a complete reinstall may resolve the issue.

Recommendation

Apply workaround: Reinstall the package using npm install -g [email protected] --force to ensure a complete and correct installation of the package and its dependencies.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

The openclaw binary starts the CLI. The shim C:\Users\Zalex\AppData\Roaming\npm\openclaw.cmd (line 17) invokes node "%dp0%\node_modules\openclaw\openclaw.mjs", so a correctly installed package must contain openclaw.mjs at C:\Users\Zalex\AppData\Roaming\npm\node_modules\openclaw\openclaw.mjs. The npm registry metadata for [email protected] declares bin: openclaw with an unpacked size of 74.5 MB, confirming the entry file is expected to be present after install

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING