bitExpert / magento2-force-login

Force Customer Login Module for Magento 2
https://marketplace.magento.com/bitexpert-magento2-force-customer-login.html
Apache License 2.0
166 stars 73 forks source link

Error while composer require 5.0 #216

Closed joachimVT closed 2 years ago

joachimVT commented 2 years ago

I'm trying to update the package to the new 5.0 release, but its working due to composer error.

Preconditions

Magento 2.4.3-p1

Force Login Module Version : 4.1.0 PHP version: 7.4

Steps to reproduce

  1. composer require bitexpert/magento2-force-customer-login:^5.0

Expected result

  1. New version 5.0 is required

Actual result

Composer error:

[InvalidArgumentException]
  Package bitexpert/magento2-force-customer-login exists in composer repo (https://repo.packagist.org) and composer repo (https://repo.magento.com) which has a higher repository priority. The packages with higher priority do not match your constraint and are therefor
  e not installable. See https://getcomposer.org/repoprio for details and assistance

Update

When I update the repositories section in composer.json it works

"0": {
    "type": "composer",
    "url": "https://repo.magento.com/",
    "exclude": ["bitexpert/magento2-force-customer-login"]
}

Any thoughts ?

shochdoerfer commented 2 years ago

Good catch, I thought about adding a section to the README.md file and then forgot about it. The main issue is that the package is available in both Packagist and Magento repo. And that is a problem (when version numbers are different), basically a new feature of Composer 2 to add a bit more security (e.g. you are not able to pull a hacked package from a 3rd party site).

You can fix it either the way you did it or declare the Magento repository as being non-canonical like this:

{
  "repositories": [
    {
      "type": "composer",
      "url": "https://repo.magento.com/",
      "canonical": false
    }
  ]
}

We are working on getting our module updated on Marketplace but the issue might occur in the future as we might not publish each minor version on Marketplace.

shochdoerfer commented 2 years ago

@joachimVT if you wanna help out, feel free to open a PR with some instructions on how to deal with the issue.

joachimVT commented 2 years ago

Hi @shochdoerfer

Thanks for the info, I'll open a PR.

shochdoerfer commented 2 years ago

Very much appreciated!