32 lines
913 B
Plaintext
32 lines
913 B
Plaintext
---
|
|||
|
|
title: "bun remove"
|
||
|
|
description: "Remove dependencies from your project"
|
||
|
|
---
|
||
|
|
|
||
|
|
import Remove from "/snippets/cli/remove.mdx";
|
||
|
|
|
||
|
|
## Basic Usage
|
||
|
|
|
||
|
|
<Note>**Alias** — `bun rm`, `bun uninstall`, `bun r`</Note>
|
||
|
|
|
||
|
|
```bash terminal icon="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`
|
||
|
|
|
||
|
|
<Note>**Alias** — `-F`</Note>
|
||
|
|
|
||
|
|
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`](/pm/cli/add#--filter). Use `--filter '*'` to remove it from every workspace package. Workspaces that don't list the package are left untouched.
|
||
|
|
|
||
|
|
```bash terminal icon="terminal"
|
||
|
|
bun remove zod --filter api
|
||
|
|
bun remove zod --filter '*'
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
<Remove />
|