bun remove
Remove dependencies from your project
Basic Usage
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
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.
bun remove zod --filter api
bun remove zod --filter '*'
CLI Usage
bun remove <package>
General Information
--helpbooleanPrint this help menu. Alias: -h
Configuration
--configstringSpecify path to config file (bunfig.toml). Alias: -c
Package.json Interaction
--no-savebooleanDon't update package.json or save a lockfile
--savebooleandefault trueSave to package.json (true by default)
--trustbooleanAdd to trustedDependencies in the project's package.json and install the package(s)
--filterstringRemove the package(s) from the matching workspaces instead of the current package. Alias: -F
Lockfile Behavior
--yarnbooleanWrite a yarn.lock file (yarn v1). Alias: -y
--frozen-lockfilebooleanDisallow changes to lockfile
--save-text-lockfilebooleanSave a text-based lockfile
--lockfile-onlybooleanGenerate a lockfile without installing dependencies
Dependency Filtering
--productionbooleanDon't install devDependencies. Alias: -p
--omitstringExclude dev, optional, or peer dependencies from install
Network & Registry
--castringProvide a Certificate Authority signing certificate
--cafilestringSame as --ca, but as a file path to the certificate
--use-system-cabooleanUse the system's trusted certificate authorities
--use-openssl-cabooleanUse OpenSSL's default CA store instead of the bundled one
--use-bundled-cabooleanUse bundled CA store
--registrystringUse a specific registry by default, overriding .npmrc, bunfig.toml and environment variables
Execution Control & Validation
--dry-runbooleanResolve the change but don't remove packages, update package.json, save a lockfile, or run the project's
lifecycle scripts
--forcebooleanAlways request the latest versions from the registry & reinstall all dependencies. Alias: -f
--no-verifybooleanSkip verifying integrity of newly downloaded packages
Output & Logging
--silentbooleanDon't log anything
--verbosebooleanExcessively verbose logging
--no-progressbooleanDisable the progress bar
--no-summarybooleanDon't print a summary
Caching
--cache-dirstringStore & load cached data from a specific directory path
--no-cachebooleanIgnore manifest cache entirely
Script Execution
--ignore-scriptsbooleanSkip lifecycle scripts for all packages, including the project's package.json and trusted dependencies
--concurrent-scriptsnumberMaximum number of concurrent jobs for lifecycle scripts (default: 2x CPU cores)
Scope & Path
--globalbooleanInstall globally. Alias: -g
--cwdstringSet a specific cwd
--env-filestringLoad environment variables from the specified file(s)
--no-env-filebooleanDisable automatic loading of .env files
Advanced & Performance
--backendstringPlatform-specific optimizations for installing dependencies. Possible values: clonefile (default on
macOS), hardlink (default on Linux and Windows), symlink, copyfile
--network-concurrencynumberdefault 64Maximum number of concurrent network requests (default 64)