Skip to content

Missing undici dependency causes ERR_MODULE_NOT_FOUND on Node.js #23

@plattenschieber

Description

@plattenschieber

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions