Forrest logo
back to the composer tool

composer:tldr:97345

composer: Uninstall a package from this project, removing it as a dependency from `composer.json`.
$ composer remove ${user-package_name}
try on your machine

The command composer remove ${user-package_name} is used to remove a specific package from a PHP project managed by Composer.

Here's how it works:

  1. composer remove is the main command that instructs Composer to remove a package.
  2. ${user-package_name} is a placeholder for the actual package name that you want to remove. You need to replace it with the name of the package you want to remove. For example, if you want to remove a package named "example/package", your command would be composer remove example/package.

When you execute this command, Composer will analyze the dependencies of the package and remove the specified package along with all its dependencies that are not required by other packages. It will also update the composer.json file and the composer.lock file to reflect the removal of the package.

Note that after removing a package, you might need to update your code or configuration files if they were using any functionality or resources provided by the removed package.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the composer tool