0

I am trying to update my Magento to 2.4.7-p5 and I am getting this error during the update process after running composer update:

Cannot declare class Dealerdirect\Composer\Plugin\Installers\PHPCodeSniffer\Plugin, because the name is already in use in vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php on line 35

Using composer 2.2 ... what could be the reason and how can I solve this?

Thanks

1 Answer 1

0

You probably try to install in the vendor the class while the class exist in your app/code, or the opposite, trying to add it in app/code while it already exist in your vendor. Check if the class namespace does not already exist in your code base.

Also to update a Magento store there is a better approach to my point of view rather than relying on composer update. Why's that ? Cause when a new user will try to install the project he will always run composer install in the first place.

Supposing we are in local first

Step 1 : Delete vendor folder.

Step 2 : Delete composer.lock

Step 3 : COMPOSER_MEMORY_LIMIT=-1 composer require-commerce magento/product-community-edition:2.4.7-p5 -W

Step 4 : Set up & di compile to make sure everything is fine.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.