Repository navigation
Description
Bug Description
npm ci fails on a fully clean checkout of main under npm 11.16.0 / node v24.2.0:
npm error code EUSAGE
npm error `npm ci` can only install packages when your package.json and package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock file with `npm install` before continuing.
npm error
npm error Invalid: lock file's @types/node@24.13.1 does not satisfy @types/node@24.13.2
Every manifest in the repo declares @types/node: ^24.12.0 (ui-tui, web, apps/desktop), which 24.13.1 satisfies — so on its face the lockfile should be valid. The failure started when @types/node@24.13.2 was published (2026-06-10T22:15Z; 24.13.1 is from 2026-06-05); before that publish, the same lockfile validated cleanly on this machine.
Downstream effect: hermes update runs npm ci in its "Updating Node.js dependencies" step, which now prints this error on every update before falling back to npm install. The fallback works, but it rewrites package-lock.json, leaving every user with a dirty working tree after each update — which then triggers the updater's stash/restore path on the next update.
Related: #6716 proposes switching install.sh from npm install to npm ci on the grounds that "npm ci works out of the box" — currently it does not, so that fix depends on this one.
Steps to Reproduce
git checkout main(c94e93a64), confirmgit statusis cleannpm --version→ 11.16.0;node --version→ v24.2.0npm ci --dry-run- EUSAGE error above (
package-lock.jsonislockfileVersion: 3)
Also reproduced through hermes update, which surfaces the same error mid-update before its npm install fallback.
Expected Behavior
npm ci validates the committed lockfile on a clean checkout and installs from it without modifying any committed file. A new version of a transitive dependency being published to the registry should not affect validation of an unchanged lockfile.
Actual Behavior
npm ci exits with EUSAGE / "lock file's @types/node@24.13.1 does not satisfy @types/node@24.13.2". npm install "repairs" it by rewriting package-lock.json (3 insertions, 29 deletions): bumps @types/node 24.13.1 → 24.13.2 and removes "peer": true from the esbuild platform package entries.
Affected Component
CLI (interactive chat), Setup / Installation
Messaging Platform (if gateway-related)
N/A (CLI only)
Debug Report
N/A — environment-independent repo-side issue: the committed package-lock.json fails
npm ci validation on a pristine checkout (full reproduction above). No agent/gateway
logs are involved; happy to run `hermes debug share` if it would still help.Operating System
Ubuntu 24.04 (WSL2, Windows 11)
Python Version
3.11.15
Hermes Version
0.16.0
Root Cause Analysis (optional)
Not fully root-caused — why npm ci is sensitive to a new registry publish at all is the open question. One possible factor: the committed lockfile records "peer": true on the esbuild platform packages, which npm 11's npm install strips when it rewrites the file — suggesting the lockfile was generated with a different npm version than 11.x. If CI pins an older npm, that would also explain why CI's npm ci doesn't catch this. The reproduction stands regardless of mechanism.
Proposed Fix (optional)
Regenerate package-lock.json with a current npm (e.g. npm install --package-lock-only on npm 11) and commit it. Optionally add a CI job that runs npm ci against the latest node LTS / npm pairing to catch future drift.
Are you willing to submit a PR for this?
- I'd like to fix this myself and submit a PR
Activity
AIalliAI commentedon Jun 11, 2026
Reproduced — taking this one. Fix incoming: regenerate
package-lock.jsonwith npm 11 sonpm civalidates on a clean checkout.zxh2010 commentedon Jun 11, 2026
Root cause found — the lockfile contains a stale nested entry that invalidates an edge, which is what forces npm to re-resolve against the registry:
For the
hermes-tuiworkspace (ui-tui/), its@types/node: ^24.12.0dev-dependency edge resolves to that nested25.9.1copy first (it shadows the rootnode_modules/@types/node@24.13.1), and25.9.1does not satisfy^24.12.0. Arborist treats the edge as invalid and re-fetches the manifest, picking the newest in-range version. From thenpm ci --dry-rundebug log:That's why validation is registry-dependent: the lockfile validated fine while
24.13.1was the latest in range, and broke the moment24.13.2was published (no repo change involved). Verified by copyingpackage.json+ the committed lockfile + all workspace manifests into a clean temp dir with nonode_modules—npm ci --dry-runfails identically, so it's independent of local state.One caution for the fix: a plain
npm installregeneration only bumps the root entry to24.13.2and keeps the staleui-tui/node_modules/@types/nodeentry (confirmed locally — the resulting lockfile passesnpm citoday). That makes the error recur the next time@types/nodepublishes a release in the^24.12.0range. To fix it durably, the regenerated lockfile needs that nested entry gone (e.g.npm dedupe, or remove the entry and re-runnpm install), so the workspace edge resolves to the root copy and validation no longer depends on registry state.m0st4f4-hub commentedon Jun 11, 2026
+1 — same root cause hits native Windows 11
Confirming @zxh2010's analysis on Windows 11 (PowerShell, no WSL, Node v24.15.0). Without the lockfile fix, the failure surfaces during the desktop install at the
tsx/esbuildpostinstall validation step in thedesktopworkspace:The
@types/nodeskew @zxh2010 documented (ui-tui/node_modules/@types/node@25.9.1shadowing the root and forcing arborist to re-resolve^24.12.0→24.13.2) is exactly what reaches the desktop workspace too —tsx's own pinnedesbuild@0.27.7ends up nested next to a freshly resolvedesbuild@0.28.0from the re-resolved tree, and the postinstall validator catches the mismatch.Windows-specific cascade (why this is critical to land)
This bug doesn't just block first-time install — it makes the desktop unrecoverable on Windows:
install-main.ps1→ fails here, no.hermes-bootstrap-completewritten.Hermes.exeanyway → desktop sees no marker → triggers auto-repair ([Bug]: Desktop install loop on macOS — launcher uses system python3 (3.9) instead of bundled venv, hermes_cli import fails, gateway never starts #43913 covers the root cause; PR fix(desktop): trust bundled venv install without marker (#43913) #43983 has the active-install heuristic fix).npm ciover the entire workspace from the GUI → hits this same lockfile bug again → fails → loop.node_modulesbefore failing.For users on tight C: drives the loop becomes destructive — there's no GUI exit. I had to manually:
os.execvpecrash ([Bug]: os.execvpe() crashes with STATUS_ACCESS_VIOLATION on Windows (Python 3.14.4), breaking profile dashboard #44282) that the auto-repair smoke-test trips,With #44024 alone applied,
npm ciis clean andtsx/esbuildpostinstall passes. Strong +1 on landing #44024 (with the dedupe caveat @zxh2010 raised so the nestedui-tuientry doesn't reappear next time@types/nodeships in the^24.12.0range).Environment
origin/main8505e9dapps/desktop(viatsx → esbuildpostinstall)AIalliAI commentedon Jun 11, 2026
Follow-up: this is fixed on
mainas of 5e5308d34d87bb898e62934d59486528cdf24764 ("fix(node): fix @types/node version") —@types/nodewas bumped to^24.13.2inui-tui,web, andapps/desktopand the lockfile regenerated, which removes the staleui-tui/node_modules/@types/node@25.9.1entry @zxh2010 identified. Verified with the same clean-room method (root + workspace manifests + committed lockfile in an empty dir, nonode_modules):8505e9d6(pre-fix):npm ci --dry-run→EUSAGE/Invalid: lock file's @types/node@25.9.1 does not satisfy @types/node@24.13.2main:npm ci --dry-run→ resolves clean (1484 packages)That supersedes #44024, and addresses the recurrence caveat in practice: the out-of-range nested entry is gone, and the per-workspace nested
@types/node@24.13.2entries that remain satisfy their^24.13.2edges, so a new registry publish can no longer invalidate the committed lockfile.On the Windows report above — a few details don't match the repo, correcting for the record so nobody chases them:
install-main.ps1. The Windows installer isscripts/install.ps1; the string "install-main" appears nowhere in the repo.tsxpinsesbuild ~0.28.0, and the nestednode_modules/tsx/node_modules/esbuild@0.28.0entry is committed in the lockfile — it is not "freshly resolved", and the root copy is0.27.7, not the other way around. The@types/nodeedge invalidation also doesn't touch esbuild resolution at all (theplaceDeplog above replaces only@types/node). If theExpected "0.28.0" but got "0.27.7"postinstall failure is real, the likely cause is different: the nestedtsx/node_modules/@esbuild/*platform entries carry"peer": trueflags in the pre-fix lockfile, and if npm skips the nested@esbuild/win32-x64@0.28.0binary, the nested esbuild'sinstall.jsfinds the hoisted0.27.7binary instead. The regenerated lockfile on main strips those peer flags too, so it should clear that symptom as well — but it's a separate mechanism from the@types/nodeskew, not the "same root cause".tsxis aui-tuidev path, not a desktop one. It enters the tree viaui-tui's dependencies and hoists to rootnode_modules/tsx; the quoted path is the root-level install, not "thedesktopworkspace".hermes --version—apps/desktop/electron/backend-probes.cjsdocuments "we intentionally avoid invoking the command with the dashboard args" — and theos.execvpere-exec that [Bug]: os.execvpe() crashes with STATUS_ACCESS_VIOLATION on Windows (Python 3.14.4), breaking profile dashboard #44282 covers only fires for a named-profile dashboard launch, which a fresh install doesn't have. Cherry-picking fix(cli): skip dashboard re-exec on Windows to avoid execvpe segfault #44355 should not be necessary to recover a first-time Windows install.With main verified clean, this issue can probably be closed (the #6716 dependency noted in the report is now unblocked too).
m0st4f4-hub commentedon Jun 11, 2026
@AIalliAI thanks for the detailed breakdown — corrections noted, all four points fair:
scripts/install.ps1—install-main.ps1was a fabricated filename on my end (likely a copy-paste from a different project's bootstrap). My apologies for the noise.@types/nodecascade. You're right — theplaceDeplog only replaces@types/node, and the nestedtsx/node_modules/esbuild@0.28.0is committed in the pre-fix lockfile, not freshly resolved. The"peer": trueflags on the nested@esbuild/*platform entries are the real cause of theExpected "0.28.0" but got "0.27.7"postinstall on Windows. Two adjacent bugs in the same lockfile, not one root cause — I conflated them.tsxhoists to rootnode_modules/tsxviaui-tui, not adesktop-workspace dep. Theapps/desktop/...path I quoted was the root install seen during the desktop workspace's pack step, not a desktop-owned path. Misleading framing on my end.apps/desktop/electron/backend-probes.cjs— the install probe ishermes --version, nothermes dashboard. Theos.execvpecrash I hit was from me manually runninghermes dashboard --profile <name>after the install to verify the gateway, which is a separate code path (the named-profile re-exec). That belongs entirely on [Bug]: os.execvpe() crashes with STATUS_ACCESS_VIOLATION on Windows (Python 3.14.4), breaking profile dashboard #44282 / fix(cli): skip dashboard re-exec on Windows to avoid execvpe segfault #44355, not here.I'll reset our local hermes-agent checkout to current
main(5e5308d3or later), drop our#44024cherry-pick, and re-runscripts/install.ps1clean on Windows 11 to confirm the install path is unblocked end-to-end. Will report back on this thread with the result so it can be closed with confidence.Thanks again for taking the time to correct the record.
m0st4f4-hub commentedon Jun 11, 2026
Re-tested on current
main— clean pass on Windows 11@AIalliAI as promised. Verified
origin/mainHEAD (6c752ca3a"refactor(agent): tighten SUMMARY_PREFIX wording", which has5e5308d34"fix(node): fix @types/node version" as ancestor) using your clean-room method on native Windows 11 —git worktreecheckout with nonode_modulespresent, thennpm ci --dry-run:Same package count you reported (
1484), noEUSAGE, noInvalid: lock file's @types/node@... does not satisfy .... Plan resolves@types/node 24.13.2cleanly through the per-workspace nested entries; the staleui-tui/node_modules/@types/node@25.9.1is gone from the regenerated lockfile as expected.So from the Windows side,
#44121is reproducibly fixed onmain— no need for #44024 cherry-pick. Happy to see it closed.(Also confirms the recurrence concern @zxh2010 raised in the original analysis: a future
^24.13.2-range publish can't invalidate the committed lockfile because the per-workspace nested entries already pin24.13.2.)Regenerate package-lock.json with npm 11 so npm ci validates on clean…
teknium1 commentedon Jul 14, 2026
This is an automated hermes-sweeper review. The lockfile mismatch described here has already been fixed on
main.5e5308d34d87f65ff60a984210492a188419a1af(fix(node): fix @types/node version) updated the workspace ranges to^24.13.2and replaced the invalidui-tui/node_modules/@types/node@25.9.1lock entry with24.13.2.mainhas since movedui-tui/package.json:30,web/package.json:41, andapps/desktop/package.json:127to^22.20.0; matching nested lock entries are present atpackage-lock.json:213,package-lock.json:19574, andpackage-lock.json:19713.25.9.1entry. The issue discussion's clean-room confirmations are therefore consistent with the committed fix.v2026.6.19.