Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should dependencies be deleted from disk automatically after install/update with Composer?

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.

like image 991
ChocoDeveloper Avatar asked Jul 27 '12 01:07

ChocoDeveloper


People also ask

What does composer update do?

We also know that if you want to update your dependencies, you simply run composer update . This will update the currently installed dependencies to their latest versions (as meets your composer. json version spec).

How do I revert my composer update?

Update and Revert Version To update the composer to the latest version, simply run the "self-update" command, and to revert back to the previous version do pass in the --rollback.


1 Answers

Running a composer update will remove packages you removed from your 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.

like image 114
Jakub Zalas Avatar answered Sep 20 '22 01:09

Jakub Zalas