How to remove unused dependencies from composer?(如何从作曲家中删除未使用的依赖项?)
问题描述
我用 composer 安装了一个包,它还安装了许多其他包作为依赖项.
I installed a package with composer, and it installed many other packages as dependencies.
现在我用 composer remove packageauthor/packagename
卸载了主包,但没有删除所有旧的依赖项.我希望作曲家清理并仅保留根据 composer.json
及其依赖项所需的包.
Now I uninstalled the main package with composer remove packageauthor/packagename
, but all the old dependencies were not removed. I expected composer to clean up and only keep packages that are required according to composer.json
and their dependencies.
如何强制作曲家清理并删除所有未使用的包?
How can I force composer to clean up and remove all unused packages ?
推荐答案
正确的做法是:
composer remove jenssegers/mongodb --update-with-dependencies
我必须承认这里的标志对于它的作用并不是很明显.
I must admit the flag here is not quite obvious as to what it will do.
composer remove jenssegers/mongodb
截至 v1.0.0-beta2 --update-with-依赖项
是默认的,不再需要.
As of v1.0.0-beta2 --update-with-dependencies
is the default and is no longer required.
这篇关于如何从作曲家中删除未使用的依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何从作曲家中删除未使用的依赖项?


基础教程推荐
- mysqli_insert_id 是否有可能在高流量应用程序中返回 2021-01-01
- 在多维数组中查找最大值 2021-01-01
- XAMPP 服务器不加载 CSS 文件 2022-01-01
- 超薄框架REST服务两次获得输出 2022-01-01
- 在 PHP 中强制下载文件 - 在 Joomla 框架内 2022-01-01
- WooCommerce 中选定产品类别的自定义产品价格后缀 2021-01-01
- 在 Woocommerce 中根据运输方式和付款方式添加费用 2021-01-01
- 如何在 PHP 中的请求之间持久化对象 2022-01-01
- 通过 PHP SoapClient 请求发送原始 XML 2021-01-01
- Libpuzzle 索引数百万张图片? 2022-01-01