Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions hermes_cli/update_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -1739,6 +1739,11 @@ def _npm_lockfile_changed(hermes_root: Path) -> bool:
# node_modules means the cache was recorded by another checkout.
if not (_m().PROJECT_ROOT / "node_modules").is_dir():
return True
# An interrupted or corrupted npm install may leave node_modules/ present
# but missing npm's hidden lockfile (.package-lock.json). Treat that as
# "changed" so we force a reinstall instead of silently breaking the TUI.
if not (_m().PROJECT_ROOT / "node_modules" / ".package-lock.json").is_file():

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests/hermes_cli/test_cmd_update.py:101-106 currently creates node_modules/ without this marker and expects _npm_lockfile_changed() to return False; this guard will make that test fail. Please update that healthy-tree fixture to create the marker and add a missing-marker regression case.

return True
# A matching lockfile hash over a tree whose web build toolchain never
# landed must NOT skip the reinstall — otherwise every later `hermes
# update` keeps rebuilding against a half-installed tree and serving a
Expand Down