Missing undici dependency causes ERR_MODULE_NOT_FOUND on Node.js #8

Open
opened 2026-02-15 17:15:02 -05:00 by yindo · 2 comments
Owner

Originally created by @plattenschieber on GitHub (Jan 23, 2026).

Description

The clawdhub package (v0.3.0) fails to run with npx on Node.js because the undici package is imported but not listed in dependencies.

Error

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'undici' imported from /home/user/.npm/_npx/.../node_modules/clawdhub/dist/http.js
    at Object.getPackageJSONURL (node:internal/modules/package_json_reader:316:9)
    ...

Root Cause

In dist/http.js:6:

import { Agent, setGlobalDispatcher } from 'undici';

But undici is not listed in package.json dependencies:

"dependencies": {
  "@clack/prompts": "^0.11.0",
  "arktype": "^2.1.29",
  "commander": "^14.0.2",
  "fflate": "^0.8.2",
  "ignore": "^7.0.5",
  "json5": "^2.2.3",
  "mime": "^4.1.0",
  "ora": "^9.0.0",
  "p-retry": "^7.1.1",
  "semver": "^7.7.3"
}

Fix

Add undici to the dependencies in package.json:

"dependencies": {
  "undici": "^7.0.0",
  // ... existing deps
}

Environment

  • Node.js v25.3.0
  • clawdhub v0.3.0
  • Linux

Workaround

Manually install undici in the npx cache:

cd ~/.npm/_npx/<hash>/node_modules && npm install undici

Or use Bun instead (has curl fallback):

bunx clawdhub@latest install <skill>
Originally created by @plattenschieber on GitHub (Jan 23, 2026). ## Description The `clawdhub` package (v0.3.0) fails to run with `npx` on Node.js because the `undici` package is imported but not listed in `dependencies`. ## Error ``` Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'undici' imported from /home/user/.npm/_npx/.../node_modules/clawdhub/dist/http.js at Object.getPackageJSONURL (node:internal/modules/package_json_reader:316:9) ... ``` ## Root Cause In `dist/http.js:6`: ```javascript import { Agent, setGlobalDispatcher } from 'undici'; ``` But `undici` is not listed in `package.json` dependencies: ```json "dependencies": { "@clack/prompts": "^0.11.0", "arktype": "^2.1.29", "commander": "^14.0.2", "fflate": "^0.8.2", "ignore": "^7.0.5", "json5": "^2.2.3", "mime": "^4.1.0", "ora": "^9.0.0", "p-retry": "^7.1.1", "semver": "^7.7.3" } ``` ## Fix Add `undici` to the dependencies in `package.json`: ```json "dependencies": { "undici": "^7.0.0", // ... existing deps } ``` ## Environment - Node.js v25.3.0 - clawdhub v0.3.0 - Linux ## Workaround Manually install undici in the npx cache: ```bash cd ~/.npm/_npx/<hash>/node_modules && npm install undici ``` Or use Bun instead (has curl fallback): ```bash bunx clawdhub@latest install <skill> ```
Author
Owner

@webdevtodayjason commented on GitHub (Jan 26, 2026):

Can confirm this issue on Node v20.20.0 (LTS) with ClawdHub v0.3.0 on macOS arm64.

The workaround of manually installing undici in the ClawdHub installation directory works:

cd ~/.nvm/versions/node/v20.20.0/lib/node_modules/clawdhub
npm install undici

After this, ClawdHub runs successfully. This confirms that adding undici to the dependencies in package.json will fix the issue for all users.

@webdevtodayjason commented on GitHub (Jan 26, 2026): Can confirm this issue on Node v20.20.0 (LTS) with ClawdHub v0.3.0 on macOS arm64. The workaround of manually installing `undici` in the ClawdHub installation directory works: ```bash cd ~/.nvm/versions/node/v20.20.0/lib/node_modules/clawdhub npm install undici ``` After this, ClawdHub runs successfully. This confirms that adding `undici` to the `dependencies` in `package.json` will fix the issue for all users.
Author
Owner

@webdevtodayjason commented on GitHub (Jan 26, 2026):

Update: Fix is already in the repository!

I've investigated the git history and found that:

  1. The fix is already committed - undici: "^7.16.0" is in packages/clawdhub/package.json on the main branch
  2. v0.3.0 was published without it - The v0.3.0 tag (commit 31e9a57) was created before undici was added to dependencies
  3. 🎯 Solution: Publish a new version - A new release (v0.3.1 or v0.4.0) will fix this for all users

Verification:

# v0.3.0 tag does NOT have undici
git show v0.3.0:packages/clawdhub/package.json | grep undici
# (returns nothing)

# main branch DOES have undici  
git show main:packages/clawdhub/package.json | grep undici
# "undici": "^7.16.0"

Request: Can a maintainer please publish a new patch release (v0.3.1) to npm with the fixed dependencies?

@webdevtodayjason commented on GitHub (Jan 26, 2026): ## Update: Fix is already in the repository! I've investigated the git history and found that: 1. ✅ **The fix is already committed** - `undici: "^7.16.0"` is in `packages/clawdhub/package.json` on the `main` branch 2. ❌ **v0.3.0 was published without it** - The v0.3.0 tag (commit `31e9a57`) was created before `undici` was added to dependencies 3. 🎯 **Solution: Publish a new version** - A new release (v0.3.1 or v0.4.0) will fix this for all users **Verification:** ```bash # v0.3.0 tag does NOT have undici git show v0.3.0:packages/clawdhub/package.json | grep undici # (returns nothing) # main branch DOES have undici git show main:packages/clawdhub/package.json | grep undici # "undici": "^7.16.0" ``` **Request:** Can a maintainer please publish a new patch release (v0.3.1) to npm with the fixed dependencies?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: openclaw/clawhub#8