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
Last updated
Was this helpful?
https://stackoverflow.com/questions/64597051/how-to-downgrade-or-install-a-specific-version-of-composer/64598028#64598028
Last updated
Was this helpful?
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.
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:
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
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
php composer self-update --1
composer self-update --rollback
I found a flag in composer installer "--1" and "--2". I'm using this command inside of my Dockerfile:
You can use following code for update to specific versions
or
phar
instead.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
The below command is used to update the specific version of the composer.
Asked 4 years, 3 months agoModified Viewed 281k times Part of Collective143
Follow47.4k1818 gold badges130130 silver badges153153 bronze badgesasked Oct 29, 2020 at 18:211,61822 gold badges1212 silver badges1414 bronze badges
composer --version
to check the current version –
Followanswered Oct 29, 2020 at 19:3347.4k1818 gold badges130130 silver badges153153 bronze badges
4Just want to add, if get permission error like me, then add "sudo" to run the cmd. –
Additional info: If you're inside of a version, you can change by using de specific version number. Let's say you're in composer 1.10.17
whats currently latest and want to have e.g. 1.10.1
you can use composer self-update 1.10.1
this would change it. But changing major version is as described above. –
Note that self-update
is inconsistently intelligent, in that if you specify 2.2, it'll find the latest sub-version but fail to install it, saying "You forced the install of 2.2.18 via --2.2" and "Version "2.2" could not be found" :facepalm:... so, while some might argue it may not be safe for it to install the sub-version it found, I've generally found it OK to do that with other apps when they do it automatically. Also, its other compatibility warnings tend to be on the x.y level, not on the x.y.z level, so I find the inconsistency annoying and a bit cognitively dissonant. –
composer self-update --1
or composer self-update --2
–
Hi @yivi I am getting error when i try to downgrade composer from 2 to 1. the error are, [Composer\Downloader\TransportException] curl error 28 while downloading : Connection timed out after 10018 milliseconds –
Report this ad9
Follow47.4k1818 gold badges130130 silver badges153153 bronze badgesanswered Dec 1, 2020 at 9:5413166 bronze badges7
Follow47.4k1818 gold badges130130 silver badges153153 bronze badgesanswered Dec 5, 2020 at 18:3822111 silver badge44 bronze badgesReport this ad7
Followanswered Nov 8, 2021 at 12:107111 silver badge22 bronze badges4
Followanswered May 4, 2022 at 17:286511 bronze badge1
Download specific version of composer.phar
file from :
Followanswered Sep 30, 2022 at 11:3355111 gold badge77 silver badges2727 bronze badges-1
-> (create composer1
directory in C:\composer_path)
-> (copy three file in composer
directory to composer1
directory)
-> (set path composer1
to environment variable
)
-> (run composer1 self-update --1
in cmd) because Convert to version 1.0.0
-> (test versions composer)