0

(Magento 2.3.4) I am trying to downgrade composer due to not being able to run Composer commands as follows. NOTE: from my understanding Magento 2.3 is not compatible with composer 2.

composer require stripe/stripe-php:^7

I am getting the following error which is due to composer 2.

The "dealerdirect/phpcodesniffer-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option. The "magento/inventory-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option. The "laminas/laminas-dependency-plugin" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.

It seems I am successfully able to get composer installed on root (public_html) running the following commands as i have done many times.

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --version=1.10.21

All settings correct for using Composer Downloading... Composer (version 1.10.21) successfully installed to: /home/nde89g9/composer.phar Use it: php composer.phar

php -r "unlink('composer-setup.php');"

I am getting no error from above ^ and the files are being installed.

After trying to run downgrade script its giving me the following error

composer self-update --1

The "dealerdirect/phpcodesniffer-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option. The "magento/inventory-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option. The "laminas/laminas-dependency-plugin" plugin was skipped because it requires a Plugin API version ("^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option. Warning: You forced the install of 1.10.21 via --1, but 2.0.12 is the latest stable version. Updating to it via composer self-update --stable is recommended.

Upgrading to version 1.10.21 (1.x channel).

[Composer\Downloader\FilesystemException] Filesystem exception: Composer update failed: "/opt/cpanel/composer/bin/composer" could not be wr itten. rename(/home/nde89g9/.composer/cache/composer-temp.phar,/opt/cpanel/compose r/bin/composer): Permission denied

It seems to be trying to downgrade cpanels composer rather than Magento or root composer.

Note: I have not used cpanel in years as I normally would not need it.

So the question is, HOW would I be able to downgrade composer on root when it seems to be trying to downgrade the cpanels composer?

2
  • Did you try as it suggested? You may need to run composer update with the "--no-plugins" option – Jimmy Apr 6 at 2:49
  • Yes same error. Magento 2.3.5 is not compatible with composer 2 – Demasys Apr 6 at 17:13
0

Not using correct root user for cpanel.

1
  • Adding more details makes answer useful. – Jarnail S Apr 6 at 20:56
0

Restore the composer.lock file from your version control system that was used before you updated.

The composer.lock exactly records which software was installed. So it is paramount to commit this file into version control in order to be able to go back to a working version in case of update failure.

Running composer install will always install the software versions recorded in composer.lock, it will only act like update if this file is not present.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.