Overview
Thepm remove command removes one or more dependencies from your project. It works with both production and development dependencies.
Syntax
Arguments
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
Theremove command:
- Accepts one or more package names
- Detects your project’s package manager (pnpm, bun, or npm)
- Builds the appropriate remove command
- Executes the removal
src/commands/remove.ts:18:
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> |
Better PM automatically uses the correct command for your project’s package manager.
Related Commands
- pm add - Add dependencies
- pm install - Install dependencies
- pm why - Explain why a package is installed