> ## Documentation Index
> Fetch the complete documentation index at: https://better-pm.fdarian.com/llms.txt
> Use this file to discover all available pages before exploring further.

# pm remove

> Remove dependencies from your project

## Overview

The `pm remove` command removes one or more dependencies from your project. It works with both production and development dependencies.

## Syntax

```bash theme={null}
pm remove <packages...>
```

## Arguments

<ParamField path="packages" type="string[]" required>
  One or more package names to remove
</ParamField>

## Examples

### Remove Single Package

```bash theme={null}
pm remove lodash
```

```bash Output theme={null}
Running: pnpm remove lodash
```

### Remove Multiple Packages

```bash theme={null}
pm remove lodash axios express
```

```bash Output theme={null}
Running: pnpm remove lodash axios express
```

### Remove Scoped Package

```bash theme={null}
pm remove @types/node
```

```bash Output theme={null}
Running: pnpm remove @types/node
```

### Remove Dev Dependency

```bash theme={null}
pm remove typescript
```

```bash Output theme={null}
Running: pnpm remove typescript
```

<Note>
  Unlike `pm add`, the `remove` command doesn't need a `-D` flag. It automatically removes the package regardless of whether it's a production or dev dependency.
</Note>

## How It Works

The `remove` command:

1. Accepts one or more package names
2. Detects your project's package manager (pnpm, bun, or npm)
3. Builds the appropriate remove command
4. Executes the removal

From `src/commands/remove.ts:18`:

```typescript theme={null}
const cmd = pm.buildRemoveCommand(packages);
yield* Console.log(`Running: ${pm.name} remove ${packages.join(' ')}`);
yield* runShellCommand(cmd);
```

## Package Manager Compatibility

The command works across all supported package managers:

| Package Manager | Command                    |
| --------------- | -------------------------- |
| pnpm            | `pnpm remove <packages>`   |
| bun             | `bun remove <packages>`    |
| npm             | `npm uninstall <packages>` |

<Info>
  Better PM automatically uses the correct command for your project's package manager.
</Info>

## Related Commands

* [pm add](/commands/add) - Add dependencies
* [pm install](/commands/install) - Install dependencies
* [pm why](/commands/why) - Explain why a package is installed
