Repository navigation
fix(cli): report the installed version after a self-update - #198
Merged
Merged
Conversation
bigpowers update ran npm install -g bigpowers@latest inside a live process. bin/ bigpowers.js had already require()d package.json, so when bin/setup.js read the same path after the reinstall Node returned the cached object: the banner said v2.88.5 while 2.92.0 was installed. bigpowers install looked correct only because it is a fresh process with an empty cache. - scripts/lib/cli-version.js: readPackageVersion() reads package.json from disk. - bin/setup.js: BANNER (built from pkg.version at module load) becomes banner(version); main() reads the version fresh before rendering. - bin/bigpowers.js: status and the default messages use the same helper, so no user-facing string can carry a startup snapshot. The menu these commands draw without a TTY is a separate defect, reproduced and logged as BUG-2026-11-03-cli-nontty-silent-noop (open) rather than mixed in here. Refs BUG-2026-11-03-cli-update-stale-version.
github-actions Bot
pushed a commit
that referenced
this pull request
Nov 3, 2026
## [2.93.1](v2.93.0...v2.93.1) (2026-11-03) ### Bug Fixes * **cli:** report the installed version after a self-update ([#198](#198)) ([4a2d8d0](4a2d8d0))
|
🎉 This PR is included in version 2.93.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
6 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
bigpowers updatereported the wrong version: afternpm install -g bigpowers@latestinstalled2.92.0, its banner (and menu header) still said 2.88.5, while
bigpowers install— run rightafter — correctly said 2.92.0. Fixes
BUG-2026-11-03-cli-update-stale-version.Cause.
updatereinstalls the package inside a live process.bin/bigpowers.jshas alreadyrequiredpackage.jsonby then, so whenbin/setup.js(required after the reinstall, so read fromthe new files) requires the same resolved path, Node returns the cached module object: the file is
new, the version string is the one the process booted with.
installlooked right only because it isa fresh process with an empty cache.
Fix (3 files, +54/−11):
scripts/lib/cli-version.js—readPackageVersion(root):readFileSync+JSON.parse.bin/setup.js— the module-levelBANNERtemplate (built frompkg.versionat load) becomesbanner(version), andmain()reads the version fresh before rendering the banner and intro.pkgis no longer required at all.bin/bigpowers.js—statusand the default messages use the same helper, so no user-facingstring can carry a startup snapshot.
Test plan
bash scripts/test-bigpowers-cli-version.sh→ 3 passed, 0 failedreadPackageVersion()sees the on-disk version after the path was alreadyrequired and then rewrittenupdate(snapshot2.88.5→ overwrite to2.92.0→ requirebin/setup.js) and asserts the banner carries 2.92.0; pre-fix it fails with"the banner reported the startup version (v2.88.5) after 2.92.0 was installed"
pkg.versioninto a user-facing linenode bin/bigpowers.js status→bigpowers v2.93.0 — 86 skills installednpm run compliancepass ·bash scripts/run-verification-gates.sh→ 55/55 pass (gatebigpowers-cli-versionregistered)Not in scope
The menu both commands draw when stdin has no TTY is a real but separate defect — reproduced, and
logged as
BUG-2026-11-03-cli-nontty-silent-noop(open) rather than folded into aversion-reporting fix.