1

I'm getting "Error: Unknown package has no name defined" when updating a site from 3.0.41.1 to 3.5.15.1 I had read a reinstall of composer had fixed this for someone else, but hasn't for me. This also happens on the same site (running locally) from a Windows and Mac OS machine - on the Mac I have been able to install some Craft updates, but I get the same error when updating plugins.

Plugins installed are: CKEditor, Contact Form, Redirect Manager, Twitter, Contact Form Extensions, Contact Form Honeypot.

I'm not able to remove any of the plugins via admin to see if they are breaking the update.

I've tried deleting the /vendor file and reinstalling the plugins with composer install - they all install fine without errors.

  • What is the output of composer --version? – Ottó Radics Nov 10 '20 at 10:42
  • It's: Composer version 2.0.6 2020-11-07 11:21:17 – Jaytrix Nov 11 '20 at 13:50
1

Okay, so this seems to be the incompatibility issue between craftcms/plugin-installer < 1.5.6 and Composer 2: https://github.com/craftcms/plugin-installer/issues/5

The solution is to update in multiple steps:

  1. Do a normal composer update, which will fail for a couple of plugins, but will update craftcms/plugin-installer to 1.5.6.
  2. Delete the vendor folder.
  3. Do a composer install, as the composer.lock file has already been updated in the first step, and craftcms/plugin-installer is locked to 1.5.6 now, so the plugins should install fine.
  4. Deploy to production: because the lock file is backward-compatible, whenever the "internal" Composer of the server will be upgraded to the 2.0-branch, it will be handled, as the composer.lock file is already 2.0-compatible.
  • Thanks for the help - I ended up going back to the Mac and without doing anything I was able to suddenly install and update plugins. I'm now getting the same error on another site sigh. Running composer update doesn't update anything. There's no error, just get a message saying "Nothing to install, update or remove". – Jaytrix Dec 7 '20 at 15:22

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.