Switch between multiple Composer versions
-
I need to be able to switch between composer1 and composer2. Some of my projects don't work on composer2 due to them being very old and due to old dependencies.
But for new projects, I wish to be able to use composer2.Right now, I've downloaded and extracted composer2 in a seperate folder and created an alias for it and am running it with
composer2 install
But I wish to know if laragon provides a way to switch composers easily like we can switch php?
-
@arun07as I can think of a couple of ways to do this.
If you want a specific composer version per project you can install the composer.phar to the project root, then use it with a PHP suffix e.g.
composer install
would be:php composer.phar install
Another way is to upgrade (or downgrade) the global composer to a specific version.
Downgrade to version 1:
composer self-update --1
Upgrade to version 2:
composer self-update --2