How to remove globally a package from Composer?

PhpComposer PhpCommand Line-Interface

Php Problem Overview


I ran this command to install globally PHPUnit:

composer global require 'phpunit/phpunit=3.7.*'

Now I want to uninstall globally PHPUnit.

Any ideas?

Php Solutions


Solution 1 - Php

To remove a globally installed package run:

composer global remove phpunit/phpunit

global command lets you to run many commands like install, require or update as if you were running them from the COMPOSER_HOME directory.

Read the related documentation here: http://getcomposer.org/doc/03-cli.md#global

COMPOSER_HOME depends on your system (on Linux it's ~/.composer), see http://getcomposer.org/doc/03-cli.md#composer-home for more details.

Solution 2 - Php

Also you can use another way

cd $HOME/.config/composer

And in composer.json file remove some require positions

After all execute composer update This is a long way, but more clear

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionwinksterView Question on Stackoverflow
Solution 1 - PhpJakub ZalasView Answer on Stackoverflow
Solution 2 - PhpWiRightView Answer on Stackoverflow