Bun

bun remove

To remove a dependency:

bun remove ts-node

CLI Usage

$bun remove <packages>

Flags

Operation Control

--dry-run
Don't install anything
-f,--force
Always request the latest versions from the registry & reinstall all dependencies
-g,--global
Install globally
-p,--production
Don't install devDependencies
--omit=<val>
Exclude 'dev', 'optional', or 'peer' dependencies from install

Dependency & Lockfile Management

-y,--yarn
Write a yarn.lock file (yarn v1)
--no-save
Don't update package.json or save a lockfile
--save
Save to package.json (true by default)
--frozen-lockfile
Disallow changes to lockfile
--save-text-lockfile
Save a text-based lockfile
--lockfile-only
Generate a lockfile without installing dependencies

Network & Registry

--ca=<val>
Provide a Certificate Authority signing certificate
--cafile=<val>
The same as `--ca`, but is a file path to the certificate
--registry=<val>
Use a specific registry by default, overriding .npmrc, bunfig.toml and environment variables

Performance & Concurrency

--concurrent-scripts=<val>
Maximum number of concurrent jobs for lifecycle scripts (default 5)
--network-concurrency=<val>
Maximum number of concurrent network requests (default 48)

Caching

--cache-dir=<val>
Store & load cached data from a specific directory path
--no-cache
Ignore manifest cache entirely

Script Execution

--ignore-scripts
Skip lifecycle scripts in the project's package.json (dependency scripts are never run)

Environment & Platform

-c,--config=<val>
Specify path to config file (bunfig.toml)
--cwd=<val>
Set a specific cwd
--cpu=<val>
Override CPU architecture for optional dependencies (e.g., x64, arm64, * for all)
--os=<val>
Override operating system for optional dependencies (e.g., linux, darwin, * for all)

Linking Strategy

--backend=<val>
Platform-specific optimizations for installing dependencies. Possible values: "clonefile" (default), "hardlink", "symlink", "copyfile"
--linker=<val>
Linker strategy (one of "isolated" or "hoisted")

Output & Logging

--silent
Don't log anything
--quiet
Only show tarball name when packing
--verbose
Excessively verbose logging
--no-progress
Disable the progress bar
--no-summary
Don't print a summary

Integrity & Security

--no-verify
Skip verifying integrity of newly downloaded packages
--trust
Add to trustedDependencies in the project's package.json and install the package(s)

Informational

-h,--help
Print this help menu

Examples

Remove a dependency
bun remove ts-node
Full documentation is available at https://bun.com/docs/cli/remove.