Skip to main content

Overview

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

Syntax

Arguments

string[]
required
One or more package names to remove

Examples

Remove Single Package

Output

Remove Multiple Packages

Output

Remove Scoped Package

Output

Remove Dev Dependency

Output
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.

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:

Package Manager Compatibility

The command works across all supported package managers:
Better PM automatically uses the correct command for your project’s package manager.