Skip to content

CLI crashes on any registry-loading invocation (e.g. --help): Cannot find module 'quality/metrics-collector' (5.2.9 and 5.3.0) #820

Description

@pradeaguiar

Summary

After a clean install via npx -y aiox-core@5.3.0 install --ci --merge --ide claude-code, any CLI invocation that loads the command registry crashes at require time. Reproduced identically on 5.2.9 and 5.3.0 (@aiox-squads/core-internal).

Repro

npx -y aiox-core@5.3.0 install --ci --merge --ide claude-code   # completes OK, all checks passed
node .aiox-core/cli/index.js --help

Error

Error: Cannot find module '../../../quality/metrics-collector'
Require stack:
- .aiox-core/cli/commands/metrics/record.js
- .aiox-core/cli/commands/metrics/index.js
- .aiox-core/cli/index.js

Root cause (as observed in the installed tree)

  • cli/commands/metrics/{record,show,cleanup}.js:12 do const { MetricsCollector } = require('../../../quality/metrics-collector');
  • That resolves to .aiox-core/quality/metrics-collector, but no quality/ directory exists anywhere in the installed tree (checked recursively).
  • The metrics command module is loaded eagerly by cli/index.js via cli/commands/metrics/index.js, so even --help dies — the whole CLI is unusable, not just the metrics subcommands.

Environment

  • macOS (darwin 25.5), Node v22.21.0
  • Installed payload: @aiox-squads/core-internal@5.3.0 (also verified on the previously vendored 5.2.9 — same files, same missing module)

Suggested fixes (either works)

  1. Ship quality/metrics-collector in the published payload package, or
  2. Lazy-require MetricsCollector inside the metrics command handlers (and/or guard the require) so a missing optional module cannot brick the entire CLI registry load.

🤖 Filed with Claude Code on behalf of a project using AIOX.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: cliCLI tools (bin/, packages/aios-pro-cli/)status: needs-triageAwaiting initial triagetype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions