TransWikia.com

"Error: Unknown package has no name defined" when updating Craft 3

Craft CMS Asked on May 24, 2021

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.

One Answer

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.

Answered by Ottó Radics on May 24, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP