How to force composer to reinstall a library?

Related searches

I'm using the ZF2 skeleton app and it has a .gitignore that prevents external libraries from being commited to git. While debugging I like to go and change stuff here and there in the libraries' source to learn how things work. If these were version controlled it would be very easy to revert them back to their original state.

How can I force Composer to reinstall a particular framework so that I can get a fresh -unmodified- copy again?

PS: Please don't suggest removing the .gitignore file since it's there for a reason; it prevents my third party libraries from getting into my app's repository. I can always install them during an automated deployment.

You can use the --prefer-source flag for composer to checkout external packages with the VCS information (if any available). You can simply revert to the original state. Also if you issue the composer update command composer will detect any changes you made locally and ask if you want to discard them.

Your .gitignore file is related to your root project (ZF2 skeleton) and it prevents the vendor dir (where your third party libs are) from committing to your own VCS. The ignore file is unrelated to the git repo's of your vendors.

Allow an esy way to force-reinstall a specific library � Issue #5693 , The usecase: the source code for one dependency got messed up. I would rm -rf vendor/* && composer install, but one of the packages (not the� How to force composer to reinstall a library? | Q&A ProDevsBlog

Just clear your vendors folder

rm -rf vendor/*

[SOLVED] How to force composer to reinstall a library?, You can use the --prefer-source flag for composer to checkout external packages with the VCS information (if any available). You can simply� Add an option to forcefully update or install a specific library. For example, i have a library added in vendors, which i usually edit in-place, when i'm ready to push this upstream i need to run composer to update locks and installs, it does not pickup the library change because its local git repo is already "up-to-date".

I didn't want to delete all the packages in vendor/ directory, so here is how I did it:

  1. rm -rf vendor/package-i-messed-up
  2. composer install again

Command-line interface / Commands, While it will install the latest dev release of the Drupal module/theme to simply do the following: composer require drupal/bootstrap:3.x-dev. I would argue a best� Every day we need to reinstall the nightly library for testing. so we hope composer can do like this. composer.phar install -f Overide the currently install. Currently, we using shell script to delete whole vendor/* and then run composer install again and again. I am very miss yum reinstall package-name -y. Which help us easier to reinstall or

What I did:

  1. Deleted that particular library's folder
  2. composer update --prefer-source vendor/library-name

It fetches the library again along with it's git repo

How can I force Composer to install a dev branch over a stable , Command, Description. composer install, Downloads and installs all the libraries and dependencies outlined in the composer.lock file. If the file does not exist it� Library Versioning# In the vast majority of cases, you will be maintaining your library using some sort of version control system like git, svn, hg or fossil. In these cases, Composer infers versions from your VCS, and you should not specify a version in your composer.json file.

Reinstall the dependencies. Remove the vendor folder (manually) or via rm command (if you are in the project folder, sure) on Linux before:

rm -rf vendor/

composer update -v

https://www.dev-metal.com/composer-problems-try-full-reset/

composer cheatsheet, Install, Uninstall and Update Modules/Themes/etc. with Composer. Now, we can start installing Drupal projects, like modules and themes. The drupal.org composer endpoint allows us to install modules and themes directly from drupal.org using Composer. You can read the official documentation for all of the details, but I'll go over the basics with

Since the composer.jsonfile is committed via git, all developers having access to the repository can run composer install --no-dev to install the packages. Step 6: Force autoloader optimization It is possible to get an optimized autoloader by adding the following config parameter to your composer.json file

A library does not need to be on Packagist to be used by Composer, but it enables discovery and adoption by other developers more quickly. Platform packages # Composer has platform packages, which are virtual packages for things that are installed on the system but are not actually installable by Composer.

How to reinstall a package using apt-get. Let us see some example that shows how to reinstall package and its installed dependencies on a Debian or Ubuntu Linux. The following command will reinstall rsync package. Open a terminal application and then type: $ sudo apt-get --reinstall install rsync OR # apt-get --reinstall install rsync Sample

Comments
  • One option would be to delete composer.lock and then run composer install
  • Initially your -prefer-source suggestion didn't work until I realized that I had to remove and reinstall all libraries for this to work as I intended and then composer status -v gave me the info with the changes.
  • @Loenix, unlock them.
  • I've had cases where the local cache was corrupted, so even after deleting the vendor directory I kept reinstalling a broken dependency. composer clearcache is a good addition in such cases.
  • This seems like a very radical approach considering that composer then needs to reinstall all packages when the OP just needs one package reinstalled. composer require vendor/package will do what the OP wants and in less time too. I am a bit surprised that so many have up-voted this answer.
  • if composer clearcache doesn't work you can delete the /home/[username]/.cache directory. That'll force a re-download. Useful if you use private composer packagist, in addition to packagist.composer.org, and someone makes changes without adding a new tag.
  • Composer does not necessarily only install in the vendor directory, so even as a heavy-handed approach it does not work in all situations.
  • or 'composer require vendor/package-i-messed-up' would be good too
  • If that doesn't work, you might run composer clearcache first in case the cache got corrupted for some reason.
  • If that doesn't work, you might run composer clearcache first in case the cache got corrupted for some reason.
  • Working like a charm for me, thank you :)