Skip to content

fix(cli): scope web UI npm install to --workspace web - #38396

Closed
luyao618 wants to merge 1 commit into
NousResearch:mainfrom
luyao618:fix/web-ui-npm-install-workspace-flag
Closed

fix(cli): scope web UI npm install to --workspace web#38396
luyao618 wants to merge 1 commit into
NousResearch:mainfrom
luyao618:fix/web-ui-npm-install-workspace-flag

Conversation

@luyao618

@luyao618 luyao618 commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #38358. hermes_cli/main.py::_build_web_ui() was invoking _run_npm_install_deterministic() without scoping it to the web workspace. On repos with additional workspaces (notably apps/desktop, which pulls in Electron via devDependencies), npm tries to resolve every workspace, fetches the ~200MB Electron binary, and the install step fails — surfacing as:

→ Building web UI...
⚠ Web UI npm install failed (hermes web will not be available)

during the CLI self-upgrade flow on Windows.

Root Cause

_build_web_ui() (around line 6929):

r1 = _run_npm_install_deterministic(
    npm,
    _workspace_root(web_dir),
    extra_args=("--silent",),
)

The peer call site _update_node_dependencies() step 2 already scopes the workspaced install with "--workspace", "web"; this path was inconsistent.

Fix

Add "--workspace", "web" to extra_args so npm only installs the web workspace deps, matching the pattern used elsewhere in the same module. One-line change.

Testing

pytest tests/ -k 'web_ui or build_web'
# 16 passed, 2 skipped

Risk

Minimal. The change tightens npm's workspace scope to the exact directory we are about to build, which is the documented intent. Single-workspace repos are unaffected because --workspace web is still valid when web is the only workspace.

The _build_web_ui() helper invoked _run_npm_install_deterministic with
extra_args=('--silent',), missing the workspace scoping flag. On repos
that have additional npm workspaces (notably apps/desktop with its
Electron devDependency), npm tries to resolve and install every
workspace, pulls the ~200MB Electron binary, and fails - producing the
"Web UI npm install failed (hermes web will not be available)"
warning seen during the CLI self-upgrade flow on Windows.

Other call sites (_update_node_dependencies step 2) already scope the
install with "--workspace", "web"; do the same here so the web build
path matches.

Fixes NousResearch#38358
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists labels Jun 3, 2026
@Hypnogamma

Copy link
Copy Markdown

🤖 This comment was generated by an AI agent (Hermes Agent) under authorization and direction from the human user below.
The human user encountered this bug, asked the AI to investigate the root cause and search existing issues — all steps followed the standard bug report protocol. No automated or unattended action was taken.


Hey @luyao618, thanks for this fix! I hit the exact same bug — hermes update stuck at "Building web UI..." for 74 minutes on macOS. Root cause analysis matches yours perfectly: _build_web_ui() runs npm ci at workspace root without --workspace web, pulling in apps/desktop (Electron ~200MB).

Two things blocking merge right now:

  1. Merge conflict (mergeStateStatus: DIRTY) — branch needs a rebase against main
  2. Failing test (test (1) — looks flaky, 3m timeout on a 1-line string change)

This fix would also help #38974 (another user stuck on macOS update with the same root cause). Happy to help re-test after rebase if needed.

@luyao618

luyao618 commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #af8b917 fix(termux): scope frontend npm installs by @adybag14-cyber (merged June 5) — same fix in hermes_cli/main.py, broader scope (covers TUI + web UI npm install paths, not just web). Thanks for landing the fix!

@luyao618 luyao618 closed this Jun 6, 2026
@teknium1

teknium1 commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Fixed via #40543. You spotted and fixed the same _build_web_ui workspace-scoping bug first — credited. We went with #38810's implementation because it also covered the sibling sites (TUI launch install, tool-setup post-install, and doctor npm audits) and shipped tests. Both contributors credited. Thanks!

#40543

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_build_web_ui() npm install missing --workspace web flag breaks "hermes update" on multi-workspace repos

4 participants