---
title: pun remove
description: Remove a package.
---

Remove a package from `composer.json`, then update and install. Also runs as `pun rm`.

## Usage

```bash
pun remove <packages> [options]
```

```bash
pun remove laravel/sanctum
pun rm 'spatie/*'
```

## Options

| Option | Description |
| --- | --- |
| `--no-update` | Only edit `composer.json`. |
| `-p`, `--package=<member>` | Edit this [workspace](/docs/guides/workspaces) member. |

Remove also takes the [`pun update`](/docs/commands/update#options) options (except `--dry-run`) and the [`pun install`](/docs/commands/install#options) options.

## What happens

- Removes the package from `require` or `require-dev`.
- Runs `pun update`, so unused packages leave the lock and `vendor/`.
- If the install fails, restores `composer.json` and `composer.lock`.

## Exit codes

| Code | Meaning |
| --- | --- |
| 0 | Removed and installed. |
| 2 | No `composer.json`, a failed install, or another package still needs it. |
