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:
git pull fetches new source + new pre-built packages/hermes-ink/dist/ink-bundle.js
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
node_modules/@hermes/ink/dist/ink-bundle.js ends up stale, missing new exports like evictInkCaches
- 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
- Install hermes and verify TUI works:
hermes --tui
- Run
hermes update (when an update is available that changes @hermes/ink exports)
- Run
hermes --tui
- 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:
- Rebuilds
@hermes/ink: npm run build --prefix packages/hermes-ink
- Removes the stale copy:
rm -rf node_modules/@hermes/ink
- 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
Description
After running
hermes update, launching the TUI withhermes --tuifails with:Root Cause
The TUI declares
@hermes/inkas a localfile:dependency:When npm resolves a
file:dependency, it copies the source directory intonode_modules/at install time. Any subsequent changes topackages/hermes-ink/dist/are invisible to the copy atnode_modules/@hermes/ink/dist/.The
hermes updateflow in_update_node_dependencies()(hermes_cli/main.py) runsnpm installbut does not rebuild@hermes/inkor re-sync its copy innode_modules/. This means:git pullfetches new source + new pre-builtpackages/hermes-ink/dist/ink-bundle.jsnpm installcopies the files intonode_modules/@hermes/ink/— but since the copy was already present, npm may not update it, or it copies the old state depending on timingnode_modules/@hermes/ink/dist/ink-bundle.jsends up stale, missing new exports likeevictInkCachesdist/lib/memoryMonitor.jsimportsevictInkCachesfrom@hermes/ink→ SyntaxErrorAdditionally,
_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
hermes --tuihermes update(when an update is available that changes@hermes/inkexports)hermes --tuiSyntaxErrorWorkaround
Suggested Fix
In
_update_node_dependencies(), after a successfulnpm installfor theui-tuidirectory, add a step that:@hermes/ink:npm run build --prefix packages/hermes-inkrm -rf node_modules/@hermes/inknpm installto re-copy the freshly built distThis ensures
node_modules/@hermes/ink/always reflects the latest build output after an update.Environment