😍How to install two composer in one windows system (ok)

https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#64598028

Solution 1

https://github.com/composer/composer/tags
https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#64598028
composer self-update 2.7.9

Ask Questionarrow-up-rightAsked 4 years, 3 months agoModified 1 year, 4 months agoarrow-up-rightViewed 281k times Part of PHParrow-up-right Collective143

I'm getting the following error in a project I'm setting up:

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

I've started at a new company this week, just trying to get their projects installed and there doesn't seem to be a way to change my composer version on Windows. I'd rather not update all their packages as I'm not familiar with the projects yet and have no clue what kind of implications go into that.

Sharearrow-up-rightImprove this questionarrow-up-rightFollowedited Jan 19, 2021 at 9:08arrow-up-rightyivi's user avatararrow-up-rightyiviarrow-up-right47.4k1818 gold badges130130 silver badges153153 bronze badgesasked Oct 29, 2020 at 18:21Bash's user avatararrow-up-rightBasharrow-up-right1,61822 gold badges1212 silver badges1414 bronze badges

Add a commentarrow-up-right

7 Answers

Sorted by: Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) 390

Assuming a regular composer installation, to rollback to version 1 of composer, you simply execute:

When you want to go back to version 2 (which you should, after updating or removing the incompatible plugins):


The above will take you to the latest on any of the two major versions.

You can also "update" to a specific version just by passing the version number to self-update:

After performing any self-update, you can specify --rollback to go back to the previously installed version.

Finally, if you are feeling adventurous, you can update to a pre-release version by executing:

Sharearrow-up-rightImprove this answerarrow-up-rightFollowedited Oct 18, 2021 at 13:42arrow-up-rightanswered Oct 29, 2020 at 19:33yivi's user avatararrow-up-rightyiviarrow-up-right47.4k1818 gold badges130130 silver badges153153 bronze badges

Add a commentarrow-up-rightReport this ad9

If you have already installed composer on your system. then paste the below code to downgrade the composer version with a specific version as per your need.

for ubuntu system use the below command

Sharearrow-up-rightImprove this answerarrow-up-rightFollowedited Oct 13, 2021 at 13:12arrow-up-rightyivi's user avatararrow-up-rightyiviarrow-up-right47.4k1818 gold badges130130 silver badges153153 bronze badgesanswered Dec 1, 2020 at 9:54Pratik Bharodiya's user avatararrow-up-rightPratik Bharodiyaarrow-up-right13166 bronze badgesAdd a commentarrow-up-right7

Just two commands worked for me. Currently I have composer 2.x.x , I had 1.10.x . First one command will download downgrade version and then second command will rollback to 1.x.x

  1. php composer self-update --1

  2. composer self-update --rollback

Sharearrow-up-rightImprove this answerarrow-up-rightFollowedited Oct 13, 2021 at 13:12arrow-up-rightyivi's user avatararrow-up-rightyiviarrow-up-right47.4k1818 gold badges130130 silver badges153153 bronze badgesanswered Dec 5, 2020 at 18:38Amir Khan's user avatararrow-up-rightAmir Khanarrow-up-right22111 silver badge44 bronze badgesAdd a commentarrow-up-rightReport this ad7

I found a flag in composer installer "--1" and "--2". I'm using this command inside of my Dockerfile:

Sharearrow-up-rightImprove this answerarrow-up-rightFollowanswered Nov 8, 2021 at 12:10Sergiu Savva's user avatararrow-up-rightSergiu Savvaarrow-up-right7111 silver badge22 bronze badgesAdd a commentarrow-up-right4

You can use following code for update to specific versions

or

Sharearrow-up-rightImprove this answerarrow-up-rightFollowanswered May 4, 2022 at 17:28Rajath Kamal's user avatararrow-up-rightRajath Kamalarrow-up-right6511 bronze badgeAdd a commentarrow-up-right1

Use phar instead.

Download specific version of composer.phar file from : https://getcomposer.org/downloadarrow-up-right

Place this phar file in your project root directory where you are trying to run composer install/update/require (or you can use fully qualified path for composer.phar while using it)

now instead of composer require use php composer.phar require

or for a specific version php7.1 composer.phar require //replace with your specific version if required

Sharearrow-up-rightImprove this answerarrow-up-rightFollowedited Sep 23, 2023 at 4:44arrow-up-rightanswered Sep 30, 2022 at 11:33bareMetal's user avatararrow-up-rightbareMetalarrow-up-right55111 gold badge77 silver badges2727 bronze badgesAdd a commentarrow-up-right-1

The below command is used to update the specific version of the composer.

Solution 2

for windows do the following steps:

Last updated