fix(install): require bun in install.sh to match runtime dependency#28
fix(install): require bun in install.sh to match runtime dependency#28Voskresenskyi-Serhii wants to merge 3 commits into
Conversation
The CLI binary uses a bun shebang and the build targets bun, so installing via npm leaves users with a non-functional binary. Replace the npm-first logic with a bun check and a clear error message pointing to https://bun.sh when bun is missing. Closes involvex#27
|
Reviewer's guide (collapsed on small PRs)Reviewer's GuideAdjusts the installation script to require Bun explicitly before installing the CLI, ensuring runtime and install-time dependencies match and providing a clear error message and exit code when Bun is missing. Flow diagram for updated install.sh Bun requirementflowchart TD
Start([Run install.sh]) --> CheckBun{command -v bun}
CheckBun -- not found --> Error["Error: bun is required to run @involvex/youtube-music-cli\nInstall bun: https://bun.sh\nexit 1"]
CheckBun -- found --> BunInstall["bun install -g @involvex/youtube-music-cli"]
BunInstall --> Done["youtube-music-cli installed. Run: youtube-music-cli"]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Code Review
This pull request updates the shell installation script (scripts/install.sh) to strictly require the bun runtime and removes the fallback to npm. The reviewer recommended applying the same logic to the PowerShell installation script (scripts/install.ps1) to ensure consistency and prevent issues on Windows platforms.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| if ! command -v bun >/dev/null 2>&1; then | ||
| echo "Error: bun is required to run ${PACKAGE}." >&2 | ||
| echo "Install bun: https://bun.sh" >&2 | ||
| exit 1 | ||
| fi |
There was a problem hiding this comment.
The PowerShell installation script scripts/install.ps1 still contains the old logic that falls back to npm if available. This will lead to the same issue on Windows systems (a successful installation but a non-functional CLI due to the missing bun runtime).
To ensure consistency across platforms, please update scripts/install.ps1 to also require bun and remove the npm fallback. For example:
if (!(Get-Command bun -ErrorAction SilentlyContinue)) {
throw "bun is required to run $package. Install bun: https://bun.sh"
}
bun install -g $package
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit b3802cf)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit b3802cf)Status: 1 Issue Found | Recommendation: Address before merge Overview
Issue Details (click to expand)WARNING
Other Observations (not in diff)None. Files Reviewed (2 files)
Fix these issues in Kilo Cloud Previous review (commit e8dad70)Status: No Issues Found | Recommendation: Merge The changes fix the critical issue where users without bun could successfully install the CLI via npm, but then get runtime errors because the CLI binary uses The updated script now:
Other Observations (not in diff)The PowerShell installation script (
Files Reviewed (1 file)
Reviewed by nex-n2-pro:free · 287,240 tokens |
Same fix as install.sh — replace npm-first logic with a bun check and a clear error message for Windows users. Closes involvex#27
| } else { | ||
| throw "npm or bun is required to install $package." | ||
| if (-not (Get-Command bun -ErrorAction SilentlyContinue)) { | ||
| Write-Error "bun is required to run $package. Install bun: https://bun.sh" |
There was a problem hiding this comment.
WARNING: Write-Error is unreachable for explicit exit handling because $ErrorActionPreference = 'Stop' turns it into a terminating error before exit 1 runs.
Use an error action that lets the script continue to the explicit exit status.
| Write-Error "bun is required to run $package. Install bun: https://bun.sh" | |
| Write-Error "bun is required to run $package. Install bun: https://bun.sh" -ErrorAction Continue |
Reply with @kilocode-bot fix it to have Kilo Code address this issue.
Write-Error is a terminating error when $ErrorActionPreference is Stop, preventing the explicit exit 1 from running.
Description
The
install.shscript installs the package via npm first, but the CLI binary uses a#!/usr/bin/env bunshebang and the build targets bun (--target bun). Users without bun get a successful install but a non-functional CLI that immediately fails withenv: 'bun': No such file or directory.This PR replaces the npm-first install logic with a bun availability check and a clear error message pointing to https://bun.sh when bun is missing.
Type of change
Testing
bun run test)Steps to verify:
bunis not installedbash scripts/install.shbun, re-runbash scripts/install.shbun install -gChecklist
bun run lintandbun run typecheckAdditional Notes
Closes #27
Summary by Sourcery
Bug Fixes: