LPM-cli

lpm uninstall

Remove a dependency from package.json and node_modules.

lpm uninstall <packages...>   # aliases: lpm un, lpm unlink

Drops one or more packages from package.json, removes them from node_modules, removes any local node_modules/.bin shims owned by those packages, and rewrites the local lpm.lock / lpm.lockb pair to the post-uninstall graph. When a removed package makes transitive packages unreachable, LPM prunes those orphaned entries from both the lockfile and node_modules, removes their owned bin shims as well, then cleans up empty scoped-package directories such as node_modules/@scope/.

lpm uninstall only touches dependencies and devDependencies. peerDependencies, optionalDependencies, and lpm > trustedDependencies are intentionally left alone — a peer-dep declaration is a contract with consumers and shouldn't disappear when the underlying package is removed; trust entries persist so that re-adding the same name@version doesn't silently re-open the script-trust review. Clean stale trust entries with lpm trust prune.

To remove a globally-installed CLI, pass -g. To remove source files added with lpm add, use lpm remove.

Human output reports the direct removals and any orphaned transitives:

- @scope/root@1.0.0
- @scope/leaf@1.0.0 (orphaned)
✓ Cleaned empty directories
✓ Freed 42 B on disk
✓ Done · removed 1 package in 42ms

Examples

lpm uninstall lodash
lpm un react react-dom            # multiple at once
lpm uninstall -g typescript       # remove a global install
lpm uninstall lodash --filter web # workspace member only
lpm uninstall -w eslint           # remove from workspace root

Workspaces

In a monorepo, target a specific member or the workspace root:

lpm uninstall lodash --filter web   # remove from packages/web/
lpm uninstall lodash --filter-prod ...web # prod dependency closure only
lpm uninstall -w eslint             # remove from the root package.json

--filter / --filter-prod and -w are mutually exclusive. --filter-prod uses the same grammar but ignores devDependencies during closure expansion. --changed-files-ignore-pattern <glob> and --test-pattern <glob> apply when a filter contains a [git-ref] atom. --fail-if-no-match makes a typo'd filter exit non-zero (recommended in CI). When uninstall would mutate more than one member's package.json, LPM prompts for confirmation; pass -y to skip the prompt.

See Workspaces for filter grammar.

Global

lpm uninstall -g eslint
# Equivalent to: lpm global remove eslint

--global is mutually exclusive with filters / -w / --fail-if-no-match (those are project-scoped). Both invocations route through the same global-uninstall implementation.

Flags

FlagEffect
-g, --globalRemove a globally-installed package from ~/.lpm/global/
--filter <EXPR>Workspace filter (mutually exclusive with -w and -g)
--filter-prod <EXPR>Workspace filter with production-only dependency closures (mutually exclusive with -w and -g)
--changed-files-ignore-pattern <glob>Ignore matching git-diff paths for [git-ref] filters
--test-pattern <glob>Treat matching git-diff paths as test-only for [git-ref] fan-out decisions
-w, --workspace-rootTarget the workspace root package.json
--fail-if-no-matchExit non-zero if filters match no members
-y, --yesSkip the multi-member confirmation prompt

Plus the global flags.

See also