openclaw - 💡(How to fix) Fix fix: 2026.3.13-zh.1 包构建产物缺失,导致 CLI 无法运行 [1 participants]

Official PRs (…)
ON THIS PAGE

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#59953Fetched 2026-04-08 02:38:21
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Participants
Timeline (top)
closed ×1locked ×1
RAW_BUFFERClick to expand / collapse

问题描述

npm 包 @qingchencloud/[email protected] 发布的构建产物不完整,导致安装后 CLI 无法正常运行或找不到入口文件。

复现步骤

  1. Windows 10/11,Node.js v24.14.1,npm 11.11.0
  2. npm config set prefix D:\openclaw\node-global
  3. npm install -g @qingchencloud/[email protected] --registry https://registry.npmmirror.com --force
  4. 执行 where openclawopenclaw --version,报找不到或运行报错

实际行为

1) 缺少 entry.mjs/entry.js 的依赖文件

  • dist/entry.js 依赖 subsystem-BDbeCphF.jstheme-H80Q3Qtv.js 等,但这些文件不在 npm 包内
  • npm pack --dry-run 也未列出这些文件

2) 缺少 openclaw.mjs

  • 首次安装时有,卸载后重装缺失(pnpm 全局安装/链接异常时尤为明显)

3) 全局可执行未正确链接

  • D:\openclaw\node-global\node_modules\.bin 未创建 openclaw 链接,where openclaw 找不到

期望行为

  • 包内应包含完整的 dist 构建产物(entry.js 及其依赖的 subsystem-.js、theme-.js 等)
  • 始终包含 openclaw.mjs 并正确设置 bin 字段或 postinstall 链接逻辑
  • 确保使用 npm/pnpm 全局安装时 .bin 能正确生成可执行入口

环境信息

附加信息

  • npm pack --dry-run 显示包内没有 dist/entry.js 和 dist/subsystem-*.js,但有 openclaw.mjs 和 dist/index.js
  • 通过 git insteadOf 修复后仍不可用,基本可排除网络/权限问题

建议修复

  • 确保构建产物写入 dist 并在 package.json files 中包含相应通配
  • 核对入口与 bin:将 CLI 入口明确到 bin 字段(如 "bin": { "openclaw": "dist/cli.js" }
  • 补充 CI 发布前检查:npm pack --dry-run 校验关键文件是否在包内

extent analysis

TL;DR

The most likely fix is to ensure the dist directory and its contents are properly included in the npm package by updating the files field in package.json and verifying the bin field points to the correct executable.

Guidance

  • Verify that the dist directory and its contents, including entry.js and subsystem-*.js, are included in the files field of package.json to ensure they are packaged correctly.
  • Check the bin field in package.json to ensure it points to the correct executable, such as "bin": { "openclaw": "dist/entry.js" }, to fix the global executable linking issue.
  • Run npm pack --dry-run to test the packaging process and verify that all necessary files are included before publishing the package.
  • Consider adding a CI check to verify the package contents before release to prevent similar issues in the future.

Example

{
  "name": "@qingchencloud/openclaw-zh",
  "version": "2026.3.13-zh.1",
  "files": [
    "dist/**",
    "openclaw.mjs"
  ],
  "bin": {
    "openclaw": "dist/entry.js"
  }
}

Notes

The issue seems to be related to the packaging process, and the provided suggestions should help resolve the problem. However, if the issue persists, further investigation into the build process and CI pipeline may be necessary.

Recommendation

Apply the suggested workaround by updating the files and bin fields in package.json and verifying the package contents using npm pack --dry-run. This should ensure that the necessary files are included in the package and the global executable is linked correctly.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING

openclaw - 💡(How to fix) Fix fix: 2026.3.13-zh.1 包构建产物缺失,导致 CLI 无法运行 [1 participants]