[GH-ISSUE #5259] REA 6.7.0 fails to start on Windows: ERR_MODULE_NOT_FOUND for MCP client index.mjs #3213

Closed
opened 2026-10-31 00:37:54 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @evangvas-debug on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/morluto/rea/issues/5259

Before submitting

  • I searched the open and closed issues for a related report.
  • I removed credentials, tokens, private paths, and sensitive target data.

Area

Setup, packaging, or upgrade

Observed behavior

REA 6.7.0 setup completed and registered the MCP server in Codex. However, Codex could read the installed REA skill but could not access the REA MCP tools. Running npx.cmd rea-agents@6.7.0 doctor failed with ERR_MODULE_NOT_FOUND, because @modelcontextprotocol/client/dist/index.mjs could not be found.

Reproduction

  1. Run npx.cmd rea-agents@latest setup on Windows.
  2. Select Codex and complete setup.
  3. Restart Codex and attempt to access REA MCP tools.
  4. Run codex.cmd mcp list (REA is enabled).
  5. Run npx.cmd rea-agents@6.7.0 doctor.
  6. Observe ERR_MODULE_NOT_FOUND.

Expected behavior

The REA diagnostic command should run successfully, and the configured MCP server should start and expose its tools to Codex.

Impact and scope

Observed during initial Windows setup. The diagnostic command failed on the execution shown. Codex recognizes the REA skill but has no accessible REA MCP tools. No application or target analysis was attempted. Behavior on other systems and REA versions was not tested.

REA version

rea-agents@6.7.0 (npm package; setup output)

Runtime and platform

Windows, Node.js 24.22.0, npm 11.19.1, Codex CLI 0.163.0; architecture not checked

Target and artifact context

REA CLI and MCP server startup; no analysis target

Interface

CLI

Earliest failure stage

Unknown

Relevant output or evidence

Command actually run:
npx.cmd rea-agents@6.7.0 doctor

Observed error:
Error [ERR_MODULE_NOT_FOUND]:
Cannot find module
'@modelcontextprotocol/client/dist/index.mjs'

Node suggested:
'@modelcontextprotocol/client/dist/index.cjs'

Additional verification:

  • codex.cmd mcp list shows REA as enabled.
  • The installed dependency directory contains index.cjs.
  • No index.mjs was found in that directory.
  • npm metadata reports @modelcontextprotocol/client 2.3.1 as the dependency of rea-agents@6.7.0.

Full REA MCP startup logs were not separately captured.

Typed outcome or recovery expected

A successful diagnostic result or a documented dependency compatibility error with a supported recovery procedure.

Analysis or suspected cause

Possible mismatch between the module entry point imported by REA and the files published in @modelcontextprotocol/client 2.3.1. This is a hypothesis, not a confirmed root cause.

Additional context

No response

Originally created by @evangvas-debug on GitHub (Oct 19, 2026). Original GitHub issue: https://github.com/morluto/rea/issues/5259 ### Before submitting - [x] I searched the open and closed issues for a related report. - [x] I removed credentials, tokens, private paths, and sensitive target data. ### Area Setup, packaging, or upgrade ### Observed behavior REA 6.7.0 setup completed and registered the MCP server in Codex. However, Codex could read the installed REA skill but could not access the REA MCP tools. Running `npx.cmd rea-agents@6.7.0 doctor` failed with `ERR_MODULE_NOT_FOUND`, because `@modelcontextprotocol/client/dist/index.mjs` could not be found. ### Reproduction 1. Run npx.cmd rea-agents@latest setup on Windows. 2. Select Codex and complete setup. 3. Restart Codex and attempt to access REA MCP tools. 4. Run codex.cmd mcp list (REA is enabled). 5. Run npx.cmd rea-agents@6.7.0 doctor. 6. Observe ERR_MODULE_NOT_FOUND. ### Expected behavior The REA diagnostic command should run successfully, and the configured MCP server should start and expose its tools to Codex. ### Impact and scope Observed during initial Windows setup. The diagnostic command failed on the execution shown. Codex recognizes the REA skill but has no accessible REA MCP tools. No application or target analysis was attempted. Behavior on other systems and REA versions was not tested. ### REA version rea-agents@6.7.0 (npm package; setup output) ### Runtime and platform Windows, Node.js 24.22.0, npm 11.19.1, Codex CLI 0.163.0; architecture not checked ### Target and artifact context REA CLI and MCP server startup; no analysis target ### Interface CLI ### Earliest failure stage Unknown ### Relevant output or evidence Command actually run: npx.cmd rea-agents@6.7.0 doctor Observed error: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '@modelcontextprotocol/client/dist/index.mjs' Node suggested: '@modelcontextprotocol/client/dist/index.cjs' Additional verification: - codex.cmd mcp list shows REA as enabled. - The installed dependency directory contains index.cjs. - No index.mjs was found in that directory. - npm metadata reports @modelcontextprotocol/client 2.3.1 as the dependency of rea-agents@6.7.0. Full REA MCP startup logs were not separately captured. ### Typed outcome or recovery expected A successful diagnostic result or a documented dependency compatibility error with a supported recovery procedure. ### Analysis or suspected cause Possible mismatch between the module entry point imported by REA and the files published in @modelcontextprotocol/client 2.3.1. This is a hypothesis, not a confirmed root cause. ### Additional context _No response_
bsakaguchi 2026-10-31 00:37:54 +00:00
  • closed this issue
  • added the
    triage
    bug
    labels
Author
Owner

@pablodiazjorge commented on GitHub (Oct 19, 2026):

The published @modelcontextprotocol/client@2.3.1 does ship dist/index.mjs. On Windows 11, an npm ci of rea's lockfile (which pins 2.3.1, integrity sha512-mIGZXpHs…cc3dQ==, the same the registry reports) installs dist/index.mjs (259,338 bytes) next to dist/index.cjs, and the package's exports map import to ./dist/index.mjs, the file the error names. So a copy with index.cjs but no index.mjs points to an incomplete npx cache entry rather than a broken release: an interrupted install, or the file removed afterwards (for example by antivirus).

Worth trying: npm cache verify, then delete the rea-agents entry under %LOCALAPPDATA%\npm-cache\_npx\ (or the whole _npx folder) and run npx.cmd rea-agents@6.7.0 doctor again. If index.mjs goes missing again after a clean install, Windows Security's protection history would show whether something removed it.

Not run: npx rea-agents@6.7.0 itself on this machine; the check above used a lockfile install of the same package version.

<!-- gh-comment-id:6270943054 --> @pablodiazjorge commented on GitHub (Oct 19, 2026): The published `@modelcontextprotocol/client@2.3.1` does ship `dist/index.mjs`. On Windows 11, an `npm ci` of rea's lockfile (which pins 2.3.1, integrity `sha512-mIGZXpHs…cc3dQ==`, the same the registry reports) installs `dist/index.mjs` (259,338 bytes) next to `dist/index.cjs`, and the package's `exports` map `import` to `./dist/index.mjs`, the file the error names. So a copy with `index.cjs` but no `index.mjs` points to an incomplete npx cache entry rather than a broken release: an interrupted install, or the file removed afterwards (for example by antivirus). Worth trying: `npm cache verify`, then delete the rea-agents entry under `%LOCALAPPDATA%\npm-cache\_npx\` (or the whole `_npx` folder) and run `npx.cmd rea-agents@6.7.0 doctor` again. If `index.mjs` goes missing again after a clean install, Windows Security's protection history would show whether something removed it. Not run: `npx rea-agents@6.7.0` itself on this machine; the check above used a lockfile install of the same package version.
Author
Owner

@mpratsaki commented on GitHub (Oct 22, 2026):

Tested on Windows 11 Home 10.0.26200, Node 24.18.0, npm 11.16.0, with a fresh empty npm cache (npm_config_cache set to a new folder):

  • npx.cmd -y rea-agents@6.7.0 --version → 6.7.0, exit 0
  • the npx cache entry contains @modelcontextprotocol/client/dist/index.mjs (259,338 bytes) next to index.cjs (267,131 bytes)
  • npx.cmd -y rea-agents@6.7.0 doctor runs to completion with no ERR_MODULE_NOT_FOUND (it only reports missing engines and registrations, expected without setup)

So a clean npx install of 6.7.0 works here, which supports the incomplete-npx-cache explanation above. Not tested: the reporter's Node 24.22 / npm 11.19, Codex, or their existing cache.

🤖 Drafted with Claude Code, posted with my OK

<!-- gh-comment-id:6337088828 --> @mpratsaki commented on GitHub (Oct 22, 2026): Tested on Windows 11 Home 10.0.26200, Node 24.18.0, npm 11.16.0, with a fresh empty npm cache (`npm_config_cache` set to a new folder): - `npx.cmd -y rea-agents@6.7.0 --version` → `6.7.0`, exit 0 - the npx cache entry contains `@modelcontextprotocol/client/dist/index.mjs` (259,338 bytes) next to `index.cjs` (267,131 bytes) - `npx.cmd -y rea-agents@6.7.0 doctor` runs to completion with no `ERR_MODULE_NOT_FOUND` (it only reports missing engines and registrations, expected without setup) So a clean npx install of 6.7.0 works here, which supports the incomplete-npx-cache explanation above. Not tested: the reporter's Node 24.22 / npm 11.19, Codex, or their existing cache. 🤖 Drafted with Claude Code, posted with my OK
Author
Owner

@morluto commented on GitHub (Oct 26, 2026):

Thank you for the startup report. #5353 added a targeted recovery procedure for an npx installation missing a dependency file and verified that procedure on Windows with a controlled missing-file case. A clean 6.7.0 installation in that investigation contained the reported file, so this does not establish the root cause of your original installation. I am closing the report based on the requested documented recovery; please reopen if the problem persists after following it or if you can share new startup evidence.

<!-- gh-comment-id:6428655110 --> @morluto commented on GitHub (Oct 26, 2026): Thank you for the startup report. #5353 added a targeted recovery procedure for an npx installation missing a dependency file and verified that procedure on Windows with a controlled missing-file case. A clean 6.7.0 installation in that investigation contained the reported file, so this does not establish the root cause of your original installation. I am closing the report based on the requested documented recovery; please reopen if the problem persists after following it or if you can share new startup evidence.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#3213
No description provided.