rush remove
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.
| Flag | Default | Description |
|---|---|---|
--ignore-scripts | false | Skip lifecycle scripts after reinstall |
--force | false | Re-download packages, bypassing the local store |
--no-cache | false | Disable metadata cache and shared-store reuse |
--os <os> | detected | Override OS for platform matching |
--cpu <cpu> | detected | Override CPU for platform matching |
--verbose | false | Print detailed removal progress |
Examples
Section titled “Examples”Remove a single package:
rush remove lodashRemove multiple packages at once:
rush rm express body-parserRemove with detailed output:
rush remove webpack --verboseWhat changes
Section titled “What changes”package.json— the package is removed from whichever field it appeared in (dependencies,devDependencies,optionalDependencies, orpeerDependencies)rush.lock— re-resolved without the removed package and its exclusive transitive dependenciesnode_modules/— packages no longer required by anything in the tree are cleaned up