Unable to downgrade Composer to v1

My Setup

  1. Dedicated server on DigitalOcean
  2. I’ve done everything myself as instructed in How to install Magento 2.4 and build a web server
  3. Ubuntu 20.04, PHP 7.4
  4. Magento 2.4, but I’m not there yet

What I’m trying to do

I’m trying to downgrade Composer from v2.4 to v1.10.16 as instructed in How to install Magento 2.4 and build a web server
I’m getting an error message (screenshot added). I’ve tried the whole setup process twice, at first I thought I made a mistake somewhere along the way with one of the previous steps, but I no longer think it’s the case. Without downgrading Composer, I cannot install Magento 2.4. Is there a working solution?

I actually had this same issue, I had to elevate my user session to root in order to fix it.

type (as a superuser) sudo -i and then enter your super user password.
You’ll then be able to run those composer commands.

Not sure why regular sudo doesn’t work - almost certain a filesystem permission issue.
After you do it, the magento web user will be able to run composer anyway.

1 Like

Thank you so much!
Your solution worked like a charm, such an easy fix…
I spent so much time looking for a workaround, I should have posted my issue here earlier :relieved:

1 Like

Hey I’m just glad to finally give something back!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.