How to remove globally a package from Composer?

為{幸葍}努か 提交于 2019-12-03 02:48:40

问题


I ran this command to install globally PHPUnit:

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

Now I want to uninstall globally PHPUnit.

Any ideas?


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/19217477/how-to-remove-globally-a-package-from-composer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!