Skip to content

rush remove

Terminal window
rush remove <package> [<package> ...] [flags]

Alias: rush rm

Removes one or more packages from package.json (from any dependency field), re-resolves the remaining tree, and updates node_modules/ and rush.lock.


FlagDefaultDescription
--ignore-scriptsfalseSkip lifecycle scripts after reinstall
--forcefalseRe-download packages, bypassing the local store
--no-cachefalseDisable metadata cache and shared-store reuse
--os <os>detectedOverride OS for platform matching
--cpu <cpu>detectedOverride CPU for platform matching
--verbosefalsePrint detailed removal progress

Remove a single package:

Terminal window
rush remove lodash

Remove multiple packages at once:

Terminal window
rush rm express body-parser

Remove with detailed output:

Terminal window
rush remove webpack --verbose

  • package.json — the package is removed from whichever field it appeared in (dependencies, devDependencies, optionalDependencies, or peerDependencies)
  • rush.lock — re-resolved without the removed package and its exclusive transitive dependencies
  • node_modules/ — packages no longer required by anything in the tree are cleaned up