bun remove

Remove dependencies from your project

Basic Usage#

Aliasbun rm, bun uninstall, bun r
terminal
bun remove ts-node

Bun removes the package from every dependency group in package.json that lists it and updates bun.lock. Once nothing else depends on the package, Bun deletes it from node_modules.

--filter#

Alias-F

In a monorepo, remove the package from the matching workspace(s) instead of the current directory's package, using the same patterns as bun add --filter. Use --filter '*' to remove it from every workspace package. Workspaces that don't list the package are left untouched.

terminal
bun remove zod --filter api
bun remove zod --filter '*'

CLI Usage#

terminal
bun remove <package>

General Information#

--helpboolean

Print this help menu. Alias: -h

Configuration#

--configstring

Specify path to config file (bunfig.toml). Alias: -c

Package.json Interaction#

--no-saveboolean

Don't update package.json or save a lockfile

--savebooleandefault:true

Save to package.json (true by default)

--trustboolean

Add to trustedDependencies in the project's package.json and install the package(s)

--filterstring

Remove the package(s) from the matching workspaces instead of the current package. Alias: -F

Lockfile Behavior#

--yarnboolean

Write a yarn.lock file (yarn v1). Alias: -y

--frozen-lockfileboolean

Disallow changes to lockfile

--save-text-lockfileboolean

Save a text-based lockfile

--lockfile-onlyboolean

Generate a lockfile without installing dependencies

Dependency Filtering#

--productionboolean

Don't install devDependencies. Alias: -p

--omitstring

Exclude dev, optional, or peer dependencies from install

Network & Registry#

--castring

Provide a Certificate Authority signing certificate

--cafilestring

Same as --ca, but as a file path to the certificate

--registrystring

Use a specific registry by default, overriding .npmrc, bunfig.toml and environment variables

Execution Control & Validation#

--dry-runboolean

Resolve the change but don't remove packages, update package.json, or save a lockfile (the project's own lifecycle scripts still run)

--forceboolean

Always request the latest versions from the registry & reinstall all dependencies. Alias: -f

--no-verifyboolean

Skip verifying integrity of newly downloaded packages

Output & Logging#

--silentboolean

Don't log anything

--verboseboolean

Excessively verbose logging

--no-progressboolean

Disable the progress bar

--no-summaryboolean

Don't print a summary

Caching#

--cache-dirstring

Store & load cached data from a specific directory path

--no-cacheboolean

Ignore manifest cache entirely

Script Execution#

--ignore-scriptsboolean

Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies

--concurrent-scriptsnumber

Maximum number of concurrent jobs for lifecycle scripts (default: 2x CPU cores)

Scope & Path#

--globalboolean

Install globally. Alias: -g

--cwdstring

Set a specific cwd

Advanced & Performance#

--backendstring

Platform-specific optimizations for installing dependencies. Possible values: clonefile (default on macOS), hardlink (default on Linux and Windows), symlink, copyfile

--network-concurrencynumberdefault:48

Maximum number of concurrent network requests (default 48)