cancel
Showing results for 
Search instead for 
Did you mean: 

Set composer back to composer 1x

Set composer back to composer 1x

Hi have composer 2.0.7, but now I cannot update Magento anymore. When I am using:

 

composer self-update --1

 

It says:

Upgrading to version 1.10.19 (1.x channel).

 

 [Composer\Downloader\FilesystemException]                                  

  Filesystem exception:                                                      

  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?

5 REPLIES 5

Re: Set composer back to composer 1x

Hello @alexander_jorda 

 

check the following answers to give permission to composer :

https://stackoverflow.com/questions/30956424/permission-denied-for-composer-in-usr-local-bin

 

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

or

sudo -H composer self-update 1.4.1

 

Hope it helps !

Problem Solved ? Click on 'Kudos' & Accept as Solution ! Smiley Happy

Re: Set composer back to composer 1x

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.

Re: Set composer back to composer 1x

Having the same trouble myself. What is the exact syntax for composerv1 update? 

Re: Set composer back to composer 1x

Hello @sspinn 

You can also use composer.phar file for any specific Version below v2

https://getcomposer.org/download/

Thank You

Re: Set composer back to composer 1x

If I get you correctly, I can,

1 install a specific version (like

composer-setup.php --version=1.10.17

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.