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

pm remove <packages...>

Arguments

packages
string[]
required
One or more package names to remove

Examples

Remove Single Package

pm remove lodash
Output
Running: pnpm remove lodash

Remove Multiple Packages

pm remove lodash axios express
Output
Running: pnpm remove lodash axios express

Remove Scoped Package

pm remove @types/node
Output
Running: pnpm remove @types/node

Remove Dev Dependency

pm remove typescript
Output
Running: pnpm remove typescript
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:
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 ManagerCommand
pnpmpnpm remove <packages>
bunbun remove <packages>
npmnpm uninstall <packages>
Better PM automatically uses the correct command for your project’s package manager.