bun why - BunDocumentation Index Search...⌘KInstall Bun Search...Navigation Publishing & Analysis bun whyRuntimePackage ManagerBundlerTest RunnerGuidesReferenceBlogFeedback:first-child]:!hidden peer-[.is-custom]:[&>:first-child]:sm:!hidden peer-[.is-custom]:[&>:first-child]:md:!hidden peer-[.is-custom]:[&>:first-child]:lg:!hidden peer-[.is-custom]:[&>:first-child]:xl:!hidden">Core Commandsbun installbun addbun removebun updatebunxPublishing & Analysisbun publishbun outdatedbun whybun auditbun infoWorkspace ManagementWorkspacesCatalogsbun linkbun pmAdvanced Configurationbun patchbun --filterGlobal cacheGlobal virtual storeIsolated installsLockfileLifecycle scriptsScopes and registriesOverrides and resolutionsSecurity Scanner API.npmrc support On this pageUsageArgumentsOptionsExamplesUnderstanding the OutputPublishing & Analysisbun why Copy pagespan]:line-clamp-1 overflow-hidden group flex items-center py-0.5 gap-1 text-sm text-gray-950/50 dark:text-white/50 group-hover:text-gray-950/70 dark:group-hover:text-white/70 rounded-none rounded-r-xl border px-3 border-gray-200 aspect-square dark:border-white/[0.07] bg-background-light dark:bg-background-dark hover:bg-gray-600/5 dark:hover:bg-gray-200/5" aria-label="More actions" type="button" id="radix-_R_n4ctdbsnlht5lebsnpfdb_" aria-haspopup="menu" aria-expanded="false" data-state="closed"> *]:[overflow-wrap:anywhere]"> Copy pagespan]:line-clamp-1 overflow-hidden group flex items-center py-0.5 gap-1 text-sm text-gray-950/50 dark:text-white/50 group-hover:text-gray-950/70 dark:group-hover:text-white/70 rounded-none rounded-r-xl border px-3 border-gray-200 aspect-square dark:border-white/[0.07] bg-background-light dark:bg-background-dark hover:bg-gray-600/5 dark:hover:bg-gray-200/5" aria-label="More actions" type="button" id="radix-_R_1cctdbsnlht5lebsnpfdb_" aria-haspopup="menu" aria-expanded="false" data-state="closed"> The bun why command explains why a package is installed in your project by showing the dependency chain that led to its installation.
Usage
terminal: The name of the package to explain. Supports glob patterns like @org/* or *-lodash.
Options
--top: Show only the top-level dependencies instead of the complete dependency tree.
--depth : Maximum depth of the dependency tree to display.
Examples
Check why a specific package is installed:
terminal Yes NoSuggest editsRaise issuebun outdatedPreviousbun auditNext⌘I xgithubdiscordyoutubePowered byThis documentation is built and hosted on Mintlify, a developer documentation platform
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Skip to main contentBun home pageExplain why a package is installed
bun why package>Arguments
bun why react
react@18.2.0 └─ my-app@1.0.0 (requires ^18.0.0)Check why all packages with a specific pattern are installed: terminal
bun why "@types/*"
@types/react@18.2.15 └─ dev my-app@1.0.0 (requires ^18.0.0) @types/react-dom@18.2.7 └─ dev my-app@1.0.0 (requires ^18.0.0)Show only top-level dependencies: terminal
bun why express --top
express@4.18.2 └─ my-app@1.0.0 (requires ^4.18.2)Limit the dependency tree depth: terminal
bun why express --depth 2
express@4.18.2 └─ express-pollyfill@1.20.1 (requires ^4.18.2) └─ body-parser@1.20.1 (requires ^1.20.1) └─ accepts@1.3.8 (requires ^1.3.8) └─ (deeper dependencies hidden)Understanding the Output The output shows: The package name and version being queried The dependency chain that led to its installation The type of dependency (dev, peer, optional, or production) The version requirement specified in each package’s dependencies For nested dependencies, the command shows the complete dependency tree by default, with indentation indicating the relationship hierarchy.
Was this page helpful?
bun why - Bun,AI智能索引,全网链接索引,智能导航,网页索引
- Explain why a package is installed