Bun

bun remove

To remove a dependency:

bun remove ts-node

CLI Usage

$bun remove <packages>

Flags

General Information

-h,--help
Print this help menu

Configuration

-c,--config=<val>
Specify path to config file (bunfig.toml)

Package.json Interaction

--no-save
Don't update package.json or save a lockfile
--save
Save to package.json (true by default)
--trust
Add to trustedDependencies in the project's package.json and install the package(s)

Lockfile Behavior

-y,--yarn
Write a yarn.lock file (yarn v1)
--frozen-lockfile
Disallow changes to lockfile
--save-text-lockfile
Save a text-based lockfile
--lockfile-only
Generate a lockfile without installing dependencies

Dependency Filtering

-p,--production
Don't install devDependencies
--omit=<val>
Exclude 'dev', 'optional', or 'peer' dependencies from install

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

Execution Control & Validation

--dry-run
Don't install anything
-f,--force
Always request the latest versions from the registry & reinstall all dependencies
--no-verify
Skip verifying integrity of newly downloaded packages

Output & Logging

--silent
Don't log anything
--verbose
Excessively verbose logging
--no-progress
Disable the progress bar
--no-summary
Don't print a summary

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)
--concurrent-scripts=<val>
Maximum number of concurrent jobs for lifecycle scripts (default 5)

Scope & Path

-g,--global
Install globally
--cwd=<val>
Set a specific cwd

Advanced & Performance

--backend=<val>
Platform-specific optimizations for installing dependencies. Possible values: "clonefile" (default), "hardlink", "symlink", "copyfile"
--network-concurrency=<val>
Maximum number of concurrent network requests (default 48)

Examples

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