Search code examples
githubcomposer-php

Composer: missing SOME files in vendor folders


How can I force composer to re-install completely all my vendor packages?

I lost most of my JS files inside the vendor folders while syncing with the server. It happens. What I noticed is that there's no command to force composer to RE-install completely a package. What it does, is that it checks if the version is the latest uploaded and if it is it skip that package. Also deleting the lock file won't work.

Any way to solve this?


Solution

  • If you delete the vendor directory of the package, then it will be reinstalled on the next install or update. For example if the package is called foo/bar, deleting vendor/foo/bar will do the trick. If it's a plugin to some CMS or something it might be in another location than vendor though, if you have a recent composer (run composer self-update to make sure) you can check where it is located by running composer show -iP, the output should list all packages and their install path.