Skip to content

Fix Bun manager detection, search, and global package listing (#4859)#4880

Merged
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
Fix-Bun-Manager
Jun 5, 2026
Merged

Fix Bun manager detection, search, and global package listing (#4859)#4880
Gabriel Dufresne (GabrielDuf) merged 1 commit into
mainfrom
Fix-Bun-Manager

Conversation

@GabrielDuf
Copy link
Copy Markdown
Contributor

@GabrielDuf Gabriel Dufresne (GabrielDuf) commented Jun 4, 2026

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.

@GabrielDuf Gabriel Dufresne (GabrielDuf) merged commit 8404d1c into main Jun 5, 2026
3 checks passed
@GabrielDuf Gabriel Dufresne (GabrielDuf) deleted the Fix-Bun-Manager branch June 5, 2026 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants