fix(cli): scope web UI npm install to --workspace web - #38396
Conversation
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
Hey @luyao618, thanks for this fix! I hit the exact same bug — Two things blocking merge right now:
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. |
|
Closing in favor of #af8b917 |
|
Fixed via #40543. You spotted and fixed the same |
Summary
Fixes #38358.
hermes_cli/main.py::_build_web_ui()was invoking_run_npm_install_deterministic()without scoping it to thewebworkspace. On repos with additional workspaces (notablyapps/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:during the CLI self-upgrade flow on Windows.
Root Cause
_build_web_ui()(around line 6929):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"toextra_argsso npm only installs the web workspace deps, matching the pattern used elsewhere in the same module. One-line change.Testing
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 webis still valid whenwebis the only workspace.