使用Composer安装/更新后,是否应该从磁盘上自动删除依赖项? [英] Should dependencies be deleted from disk automatically after install/update with Composer?

查看:106
本文介绍了使用Composer安装/更新后,是否应该从磁盘上自动删除依赖项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从composer.json删除依赖项并运行安装或更新后,我是否应该期望从磁盘上自动删除文件?

After removing a dependency from composer.json and running install or update, should I expect the files to be removed automatically from disk?

我必须手动删除它们,不确定我是否应该这样做。

I had to remove them manually, not sure if I am supposed to.

推荐答案

运行作曲家 update 将删除您删除的软件包

Running a composer update will remove packages you removed from your composer.json.

由于安装使用 composer.lock 而不是 composer.json ,它将删除从您的 composer.json 中删除的软件包。但是,您应该收到一条消息,指出您的锁定文件与 composer.json 不同步,并且应该运行更新。

Since install uses composer.lock instead of composer.json it will not remove packages removed from your composer.json. However, you should get a message that your lock file is out of sync with your composer.json and you should run an update.

这篇关于使用Composer安装/更新后,是否应该从磁盘上自动删除依赖项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆