remove Verified current stable Not installed? Package Management

Remove / Uninstall Module Remove Dependency

Uninstall Module Remove Dependency

Removes a specified module from the project dependencies in Yarn.

$
Terminal
yarn remove <module_name>

When To Use

When deprecating a module or replacing it with a different dependency.

Pro Tip

Use the --no-save flag if you want to remove the module locally without updating package.json.

Warning

Destructive operation. Confirm the target path and keep a backup before executing.

Command Builder

Tune the command before you copy it

Back to syntax
$
Generated Command
yarn remove <module_name>

Anatomy of Output

Understanding the result

success Removed "{{module_name}}" from dependencies. Removal Confirmation

Confirms successful uninstallation of the module.

info Updated lockfile. Lockfile Update

Yarn.lock file is updated to reflect the removal.

info Total removed packages: 1 Package Count

Total number of packages uninstalled in this operation.

Troubleshooting

Common pitfalls

Error: Module not found in dependencies

Solution: Verify the module name in package.json.

Error: Cannot remove a module that's a dependency of another module

Solution: Update other modules to remove reliance on this module.

Error: Insufficient permissions

Solution: Run with elevated permissions or check user access rights.

Command Breakdown

What each part is doing

yarn
Base Command
The executable that performs this operation. Here it runs Remove before the shell applies any redirect operators.
<module_name>
module name
The value supplied for module name.

Alternative Approaches

Comparable commands in other tools

Alternative package management tools for the same job.