Hi have composer 2.0.7, but now I cannot update Magento anymore. When I am using:
composer self-update --1
Upgrading to version 1.10.19 (1.x channel).
Composer update failed: "/usr/local/bin/composer" could not be written.
rename(/usr/local/bin/composer): failed to open stream: Permission denied
So, it is not set back to composer 1. What should I do to get composer 1 again?
check the following answers to give permission to composer :
to switch composer version to composer 1, you should able to use self-update command to downgrade to any version:
composer self-update 1.4.1
sudo -H composer self-update 1.4.1
Hope it helps !
Thanks for your answer!
I have solved it already. Because I have a shared hosting, I cannot change the composer version, but what I should do to use composer version 1 is just adding "v1". So in stead of composer update, I am using now composerv1 update.
If I get you correctly, I can,
1 install a specific version (like
2. Since I can't use sudo and don't have permission to mess with usr/local/bin, I can install it to a specific directory, other than that, say my public_html?
3. If i rename it to read "composer1", and do all of the above, I will be able to use composer commands by calling composer1 rather than composer, and it should work, regardless of composer 2 existing globally?
The issue I'm having is that Magento is 2.3. something, and now with composer updated to 2, my CLI isn't working and I'm getting a bunch of other issues with different pages in my store.