Fix Bun manager detection, search, and global package listing (#4859)#4880
Merged
Conversation
Marc-André Moreau (mamoreau-devolutions)
approved these changes
Jun 4, 2026
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.
Fixes three bugs in the Bun package manager that prevented it from being detected and used correctly. (#4859)
1. Bun installed via npm was not detected
FindCandidateExecutableFiles only searched for bun.exe. The official installer ships bun.exe, but npm i -g bun only places a bun.cmd wrapper on the PATH (the real bun.exe stays inside node_modules, off-PATH). As a result Bun showed as "not found" in manager preferences for npm-based installs. Now both bun.exe and bun.cmd are searched — matching how the npm (npm.cmd) and Scoop (scoop.ps1) managers locate their wrappers.
2. Package search never worked
FindPackages_UnSafe ran bun search "" --json, but Bun has no search command — the call always failed with error: Script not found "search". Confirmed against the CLI (bun search / bun pm search), the official docs (no such command in the index), and the maintainers' own discussion
3. Installed packages listed the wrong directory
GetInstalledPackages_UnSafe ran bun pm ls --global from the user-profile directory. Bun ignores the --global flag for bun pm ls and walks up the directory tree to the nearest lockfile, so it listed whatever node_modules happened to be above the working directory. It now runs from the dedicated global directory with the same HasGlobalPackageManifest guard used by GetAvailableUpdates_UnSafe, and drops the ignored --global flag.
Also a minor consistency fix: added a missing space before the --version argument in _loadManagerVersion.