php 如何从 Composer 全局删除一个包?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/19217477/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to remove globally a package from Composer?
提问by winkster
I ran this command to install globally PHPUnit:
我运行这个命令来全局安装PHPUnit:
composer global require 'phpunit/phpunit=3.7.*'
Now I want to uninstall globally PHPUnit.
现在我想全局卸载PHPUnit。
Any ideas?
有任何想法吗?
回答by Jakub Zalas
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.
global
command 允许您运行许多命令,例如install
,require
或者update
就好像您是从COMPOSER_HOME
目录中运行它们一样。
Read the related documentation here: http://getcomposer.org/doc/03-cli.md#global
在此处阅读相关文档: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-homefor more details.
COMPOSER_HOME
取决于您的系统(在 Linux 上是~/.composer
),请参阅http://getcomposer.org/doc/03-cli.md#composer-home了解更多详细信息。
回答by WiRight
Also you can use another way
你也可以用另一种方式
cd $HOME/.config/composer
And in composer.json
file remove some require positions
并在composer.json
文件中删除一些需要的位置
After all execute composer update
This is a long way, but more clear
毕竟executecomposer update
这是很长的一段路,但更清晰