openclaw - 💡(How to fix) Fix [Bug]: Missing files in npm package: dist/package.json and docs templates missing after npm install -g [1 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#54404Fetched 2026-04-08 01:28:03
View on GitHub
Comments
0
Participants
1
Timeline
2
Reactions
0
Author
Participants
Timeline (top)
labeled ×2

After running npm install -g openclaw@latest, the installed npm package is missing critical files:

  1. dist/package.json - Missing from the installed package
  2. dist/docs/reference/templates/AGENTS.md - Missing from the installed package

Root Cause

After running npm install -g openclaw@latest, the installed npm package is missing critical files:

  1. dist/package.json - Missing from the installed package
  2. dist/docs/reference/templates/AGENTS.md - Missing from the installed package
RAW_BUFFERClick to expand / collapse

Bug type

Regression (worked before, now fails)

Summary

After running npm install -g openclaw@latest, the installed npm package is missing critical files:

  1. dist/package.json - Missing from the installed package
  2. dist/docs/reference/templates/AGENTS.md - Missing from the installed package

Steps to reproduce

  1. Run npm install -g openclaw@latest
  2. Check: ls ~/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/dist/package.json
  3. Result: No such file or directory

Expected behavior

The npm package should include all files that were present during the build/pack step, including:

  • dist/package.json
  • dist/docs/reference/templates/AGENTS.md
  • All other files referenced in the build

Actual behavior

  1. Run npm install -g openclaw@latest
  2. Check: ls ~/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/dist/package.json
  3. Result: No such file or directory

OpenClaw version

v2026.3.23-2

Operating system

Windows/WSL2 (nvm)

Install method

No response

Model

minimax M2.7

Provider / routing chain

openclaw -> cloudflare-ai-gateway ->minimax

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

Fix Plan

The fix involves updating the package.json file to include the missing files in the files field, which specifies the files to be included in the package.

  • Update package.json to include the missing files:
"files": [
  "dist/**",
  "dist/docs/**"
]
  • Alternatively, you can use a glob pattern to include all files in the dist directory:
"files": [
  "dist/**/*"
]
  • Run npm pack to re-package the module with the updated files field.
  • Run npm install -g openclaw@latest to re-install the updated package.

Verification

To verify that the fix worked, check that the missing files are present in the installed package:

ls ~/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/dist/package.json
ls ~/.nvm/versions/node/v22.22.0/lib/node_modules/openclaw/dist/docs/reference/templates/AGENTS.md

Both commands should return the file paths without errors.

Extra Tips

  • Make sure to update the files field in the package.json file to include all necessary files for the package to function correctly.
  • Use glob patterns to include files in subdirectories, such as dist/**/*.
  • After updating the package.json file, run npm pack to re-package the module before re-installing it.

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 npm package should include all files that were present during the build/pack step, including:

  • dist/package.json
  • dist/docs/reference/templates/AGENTS.md
  • All other files referenced in the build

Still need to ship something?

×6

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

Back to top recommendations

TRENDING