Skip to content

npx install pins bb to one minor line, so the update button silently does nothing #1747

Closed as not planned

Description

@Joesirven

Summary

Installing bb with npx bb-app@latest produces an install that can never update itself. npm materializes @latest into a caret range in the npx cache entry, and that range excludes every future minor. The in-app update affordance then appears to do nothing, with no error surfaced.

My install sat on 0.35.1 for 11 days while 0.37.0 was published, and I had no indication anything was wrong beyond the version number.

Reproduction

  1. npx bb-app@latest at a time when latest is 0.35.1
  2. Wait for a new minor to be published (0.37.0)
  3. Use the update affordance in the bb UI
  4. Observe: still running 0.35.1

Cause

The npx cache entry at ~/.npm/_npx/<hash>/package.json:

{
  "dependencies": { "bb-app": "^0.35.1" },
  "_npx": { "packages": ["bb-app@latest"] }
}

The request was bb-app@latest, but npm recorded the resolved version as the caret range ^0.35.1, meaning >=0.35.1 <0.36.0. On subsequent runs npm checks whether the cached tree satisfies that range. 0.35.1 does, so it skips reinstalling and never re-resolves latest. 0.37.0 cannot satisfy ^0.35.1, so this install is permanently pinned to the 0.35.x line.

This is not a stale cache that heals on its own. It is a hard pin, and it persists across restarts.

Diagnosis notes

Two things made this hard to identify:

  1. No error is surfaced. There were no download, install, or version-check log lines in either server.*.log or host-daemon.*.log, and no partial artifact in ~/.bb/install-cache (which only ever held the tarball of the already-installed version). The update simply does not happen, silently.

  2. hostNeedsUpdate is a different path. apps/app/src/lib/host-update-status.ts covers updating a remote enrolled daemon after a protocol-version rejection. It requires host.status === "disconnected" and a non-null lastRejectedProtocolVersion. That mechanism works, and my two enrolled Macs were fine throughout. It just has nothing to do with updating the machine running the server itself.

As far as I can tell, a web-surface install launched via npx has no self-update path at all. The real auto-update machinery lives in apps/desktop, and my bb-app-runtime.json reports "surface": "web".

Impact

Anyone who followed the npx bb-app@latest install path is frozen at whatever minor they first resolved and has no signal that updates are failing. The longer the install runs, the further behind it drifts.

Suggested fixes

Any of these would help, roughly in order of how much:

  1. Do not recommend npx for persistent installs. A plain npm install --prefix <dir> bb-app@latest re-resolves latest on every invocation, so a restart is genuinely an update. This is what I moved to and it works.
  2. Detect the pin and warn. On startup, compare the running version against the registry's latest and surface a notice when they differ, rather than failing silently.
  3. Log the update attempt. Even one line saying what was checked and what was resolved would have made this a five-minute diagnosis instead of an eleven-day one.
  4. Document the trap in install docs.

Environment

  • bb 0.35.1 at time of discovery, now on 0.38.0 after switching install method
  • Ubuntu 22.04.5, Node v24.19.0, npm via nvm
  • "surface": "web", launched via npx bb-app@latest

Activity

  1. added theissue type on Aug 18, 2026
  2. added
    desktop
    on Aug 18, 2026
  3. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    Collaborator

    Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1747.html

    • Verdict: PARTIALLY REPRODUCED · root-cause confidence: medium
    • Root cause (short): The claimed npx "^0.35.1 hard pin" does not exist (npx re-resolves @latest on every run — verified with the reporter's exact cache entry, 0.35.1 -> 0.38.0); the web surface simply has no self-update (Copy-command only), and re-running npx bb-app@latest while the old bb is still running makes the launcher falsely print "bb is ready" (waitForHealth accepts the old server's /health) while its children EADDRINUSE-crash-loop and the URL keeps serving 0.35.1 — same root cause as bb-app can enroll a host against the wrong server after its server child fails with EADDRINUSE #1558.
    • Linked PR review: docs: warn that npx installs cannot self-update #1755 → CLOSE — Docs-only PR whose central claim (npx bb-app@latest pins to ^0.35.1 and can never update) is false: libnpmexec (npm 7..11.17) re-resolves the latest tag via preferOnline and compares resolved tarballs, and an empirical run against the reporter's exact cache entry upgraded 0.35.1 -> 0.38.0. It also c
    • Proposed fix: (1) packages/bb-app/src/launcher.ts: make readiness prove the spawned child answered — pass a per-launch nonce to the server/daemon children (env), echo it from GET /health (apps/server/src/server.ts) and the daemon status probe, and require a match in waitForHealth/waitForHostDaemonStatus; treat claimBbAppRuntimeFile()===false with a live pid as a hard error ("bb already runs (pid N); run npx bb-app stop then re-run"), and cap immediate crash-restart loops. (2) UI/docs: web Updates row + README/packages/bb-app README should say "stop the running bb (Ctrl+C or npx bb-app stop), then ru…
    • Caveats: Could not observe the reporter's machine; the false-ready path is the most plausible explanation for their experience but not proven to be what they did. An npmrc with prefer-offline=true (or offline=true) WOULD pin npx to the cached packument (verified: cache hit, no revalidation) — worth asking the reporter for npm config get prefer-offline offline and npm -v. Tests used isolated npm cache a…

    The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at 16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).

    AGENT GENERATED: by Claude Opus 5

  4. SawyerHood commented on Aug 18, 2026

    @SawyerHood
    Collaborator

    Closing as a duplicate of #1558. The investigation (https://get-bb.github.io/reports/issues/1747.html) showed that npx bb-app@latest does re-resolve latest (0.35.1 → 0.38.0 with your exact cache entry), so the caret pin is not what kept you on 0.35.1. What matches your symptoms is the launcher reporting "bb is ready" while the previously running bb still holds the port, so the URL keeps serving the old version — that is #1558. The remaining gap (the web UI's update surface only offers Copy-command) is a feature request rather than this bug.

    If you can reproduce a case where the npx cache truly stays pinned, please reopen with the cache package.json and npm --version.

    AGENT GENERATED: by Claude Opus 5

  5. added
    partial-repro
    on Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    desktoppartial-repro

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions