ruvnet / ruvnet/ruflo

[verification] MEDIUM: @claude-flow/cli package.json subpath not exported — ERR_PACKAGE_PATH_NOT_EXPORTED on Node 22

Open Beginner friendly
#3,121 0 comments 0 reactions 0 assignees View on GitHub
severity:medium verification
Dominant language
TypeScript
Stars
72.7k
Forks
8.6k
Avg merge
2d 23h
Merged PRs (30d)
83

Description

## Summary

Scheduled verification (2026-08-28) found that `@claude-flow/cli@3.38.20`'s `exports` field does not include `"./package.json"`. On Node v22+ with strict exports enforcement, any call to `require('@claude-flow/cli/package.json')` (or the ESM equivalent) throws `ERR_PACKAGE_PATH_NOT_EXPORTED`.

## Impact

Any tooling, script, or downstream package that reads `@claude-flow/cli`'s version or metadata via the standard subpath import pattern will fail at runtime on Node 22+ (the current active LTS). This includes version-checking utilities, plugin compatibility gates, and wrapper packages that inspect the CLI version before invoking it.

## Expected

`"./package.json": "./package.json"` present in `@claude-flow/cli/package.json`'s `exports` field, making the subpath accessible.

## Actual

```
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './package.json' is not defined
by "exports" in /tmp/ruflo-verify/pkg/node_modules/@claude-flow/cli/package.json
at exportsNotFound (node:internal/modules/esm/resolve:314:10)
at packageExportsResolve (node:internal/modules/esm/resolve:661:9)
...
code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
```

## Command

```bash
node -e 'require("@claude-flow/cli/package.json")'
# Node v22.22.2
```

## Recommended Fix

Add to `v3/@claude-flow/cli/package.json` exports:

```json
{
"exports": {
"./package.json": "./package.json",
...
}
}
```

## Environment

- Commit: `d33ef4bf8ab27a8f9ef08352c9c293b53312a861`
- Timestamp UTC: 2026-08-28T19:03:33Z
- Node: v22.22.2
- @claude-flow/cli version: 3.38.20 (alpha tag)

Contributor guide

Open the contributing guide

Research direction

Open v3/@claude-flow/cli/package.json and inspect its exports field. Run the reported Node v22 command to reproduce ERR_PACKAGE_PATH_NOT_EXPORTED, then add the ./package.json subpath and rerun the command to confirm the package metadata can be loaded.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
build-system, cli
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
88/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.