hermes - 💡(How to fix) Fix [Bug]: hermes update leaves stale @hermes/ink in node_modules, causing TUI SyntaxError on launch [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#16773Fetched 2026-04-28 06:50:49
View on GitHub
Comments
1
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×4commented ×1

After running hermes update, launching the TUI with hermes --tui fails with:

file:///home/raspberry/.hermes/hermes-agent/ui-tui/dist/lib/memoryMonitor.js:1
import { evictInkCaches } from '@hermes/ink';
         ^^^^^^^^^^^^^^
SyntaxError: The requested module '@hermes/ink' does not provide an export named 'evictInkCaches'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:213:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:320:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:606:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)

Node.js v20.20.2

Error Message

file:///home/raspberry/.hermes/hermes-agent/ui-tui/dist/lib/memoryMonitor.js:1 import { evictInkCaches } from '@hermes/ink'; ^^^^^^^^^^^^^^ SyntaxError: The requested module '@hermes/ink' does not provide an export named 'evictInkCaches' at ModuleJob._instantiate (node:internal/modules/esm/module_job:213:21) at async ModuleJob.run (node:internal/modules/esm/module_job:320:5) at async ModuleLoader.import (node:internal/modules/esm/loader:606:24) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)

Node.js v20.20.2

Root Cause

The TUI declares @hermes/ink as a local file: dependency:

"@hermes/ink": "file:./packages/hermes-ink"

When npm resolves a file: dependency, it copies the source directory into node_modules/ at install time. Any subsequent changes to packages/hermes-ink/dist/ are invisible to the copy at node_modules/@hermes/ink/dist/.

The hermes update flow in _update_node_dependencies() (hermes_cli/main.py) runs npm install but does not rebuild @hermes/ink or re-sync its copy in node_modules/. This means:

  1. git pull fetches new source + new pre-built packages/hermes-ink/dist/ink-bundle.js
  2. npm install copies the files into node_modules/@hermes/ink/ — but since the copy was already present, npm may not update it, or it copies the old state depending on timing
  3. node_modules/@hermes/ink/dist/ink-bundle.js ends up stale, missing new exports like evictInkCaches
  4. The TUI dist/lib/memoryMonitor.js imports evictInkCaches from @hermes/ink → SyntaxError

Additionally, _tui_build_needed() does not detect the mismatch because both source and dist files from git share the same mtime (they were committed together), so it considers the build up-to-date and skips rebuilding.

Fix Action

Workaround

cd ~/.hermes/hermes-agent/ui-tui
npm run build
rm -rf node_modules/@hermes/ink
npm install

Code Example

file:///home/raspberry/.hermes/hermes-agent/ui-tui/dist/lib/memoryMonitor.js:1
import { evictInkCaches } from '@hermes/ink';
         ^^^^^^^^^^^^^^
SyntaxError: The requested module '@hermes/ink' does not provide an export named 'evictInkCaches'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:213:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:320:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:606:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)

Node.js v20.20.2

---

"@hermes/ink": "file:./packages/hermes-ink"

---

cd ~/.hermes/hermes-agent/ui-tui
npm run build
rm -rf node_modules/@hermes/ink
npm install
RAW_BUFFERClick to expand / collapse

Description

After running hermes update, launching the TUI with hermes --tui fails with:

file:///home/raspberry/.hermes/hermes-agent/ui-tui/dist/lib/memoryMonitor.js:1
import { evictInkCaches } from '@hermes/ink';
         ^^^^^^^^^^^^^^
SyntaxError: The requested module '@hermes/ink' does not provide an export named 'evictInkCaches'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:213:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:320:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:606:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:117:5)

Node.js v20.20.2

Root Cause

The TUI declares @hermes/ink as a local file: dependency:

"@hermes/ink": "file:./packages/hermes-ink"

When npm resolves a file: dependency, it copies the source directory into node_modules/ at install time. Any subsequent changes to packages/hermes-ink/dist/ are invisible to the copy at node_modules/@hermes/ink/dist/.

The hermes update flow in _update_node_dependencies() (hermes_cli/main.py) runs npm install but does not rebuild @hermes/ink or re-sync its copy in node_modules/. This means:

  1. git pull fetches new source + new pre-built packages/hermes-ink/dist/ink-bundle.js
  2. npm install copies the files into node_modules/@hermes/ink/ — but since the copy was already present, npm may not update it, or it copies the old state depending on timing
  3. node_modules/@hermes/ink/dist/ink-bundle.js ends up stale, missing new exports like evictInkCaches
  4. The TUI dist/lib/memoryMonitor.js imports evictInkCaches from @hermes/ink → SyntaxError

Additionally, _tui_build_needed() does not detect the mismatch because both source and dist files from git share the same mtime (they were committed together), so it considers the build up-to-date and skips rebuilding.

Steps to Reproduce

  1. Install hermes and verify TUI works: hermes --tui
  2. Run hermes update (when an update is available that changes @hermes/ink exports)
  3. Run hermes --tui
  4. Observe the SyntaxError

Workaround

cd ~/.hermes/hermes-agent/ui-tui
npm run build
rm -rf node_modules/@hermes/ink
npm install

Suggested Fix

In _update_node_dependencies(), after a successful npm install for the ui-tui directory, add a step that:

  1. Rebuilds @hermes/ink: npm run build --prefix packages/hermes-ink
  2. Removes the stale copy: rm -rf node_modules/@hermes/ink
  3. Re-runs npm install to re-copy the freshly built dist

This ensures node_modules/@hermes/ink/ always reflects the latest build output after an update.

Environment

  • Hermes Agent v0.11.0 (2026.4.23)
  • Node.js v20.20.2, npm 9.2.0
  • OS: Linux (Debian, aarch64)
  • Python 3.11.2

extent analysis

TL;DR

Rebuilding @hermes/ink and re-syncing its copy in node_modules/ after hermes update should resolve the SyntaxError.

Guidance

  • The issue is caused by a stale copy of @hermes/ink in node_modules/ after running hermes update.
  • To verify, check the node_modules/@hermes/ink/dist/ directory for outdated files.
  • A temporary workaround is to manually rebuild @hermes/ink and re-run npm install in the ui-tui directory.
  • To mitigate, consider modifying the _update_node_dependencies() function to rebuild @hermes/ink and re-sync its copy after a successful npm install.

Example

npm run build --prefix packages/hermes-ink
rm -rf node_modules/@hermes/ink
npm install

Notes

This solution assumes that the issue is specific to the @hermes/ink package and its interaction with the hermes update flow. If the issue persists, further investigation into the hermes update process and package dependencies may be necessary.

Recommendation

Apply the suggested fix by modifying the _update_node_dependencies() function to rebuild @hermes/ink and re-sync its copy after a successful npm install, as this ensures that the node_modules/@hermes/ink/ directory always reflects the latest build output after an update.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

hermes - 💡(How to fix) Fix [Bug]: hermes update leaves stale @hermes/ink in node_modules, causing TUI SyntaxError on launch [1 comments, 1 participants]