Skip to content
Better PM
Esc
↑↓navigate↵open⌘Jpreview

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

pm remove <packages...>

Arguments

packages string[] required

One or more package names to remove

Examples

Remove Single Package

pm remove lodash
Running: pnpm remove lodash

Remove Multiple Packages

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

Remove Scoped Package

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

Remove Dev Dependency

pm remove typescript
Running: pnpm remove typescript

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 Manager Command
pnpm pnpm remove <packages>
bun bun remove <packages>
npm npm uninstall <packages>

Was this page helpful?