Magento2: Magento (2.3.x) dependency causing fresh install error (the dependency contains a faulty constraint)

Created on 4 Feb 2020  路  15Comments  路  Source: magento/magento2

Preconditions

  1. Magento version 2.3.x
  2. Composer version > 1.9.0

Steps to reproduce

  1. Create a new Magento 2.3.x project

Expected result

  1. A working Magento installation

Actual result

I received the following error for both commands:

"_Could not load package firebear/importexport in https://repo.magento.com [UnexpectedValueException] Could not parse version constraint 5.5.33 as ^5.2: Invalid version string "^5.2_".

Workaround

After downgrading composer to version 1.8.6 I was able to install Magento again. I concluded that the newer versions of composer don't support the way the dependency constraint is defined in the firebear/importexport module, thus causing said error. Firebear depends on the tightenco/collect module. The dependency is defined in the magento packages.json as follows:

_tightenco\/collect":"5.5.33 as ^5.2"_

I'm surprised I have not found any bugreports regarding this issue. This not only happened to me but my colleaugues as well.

Thank you.

Nina

Format is valid Reported on 2.3.x

Most helpful comment

Hello @ninarosemary @ainigma32 @hostep,

We confirm that the problem is on our side. Few of our first module versions contain composer alias which is not working with composer 1.9.2. Now we trying to contact people responsible for marketplace so they can disable those versions. I will be back to you as soon as I get a response from the marketplace.

All 15 comments

Thanks for opening this issue!

Hi @ninarosemary. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

@ninarosemary do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

Thanks for opening this issue!

Thanks for opening this issue!

Thanks for opening this issue!

Hi @engcom-Hotel. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.4-develop branch

    Details- Add the comment @magento give me 2.4-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.4-develop branch, please, add the label Reproduced on 2.4.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

Hello @ninarosemary
I am not able to reproduce this issue with Composer v.1.9.0

Testing scenario:
1.Create a new Magento 2.3.4 project

Result:
Composer downloaded all the packages and I installed Magento 2.3.4:
image

So i have to close this issue.

Thanks for your report!

Hello @engcom-Hotel ,

As mentioned in the preconditions, a composer version is required above 1.9.0. Anything below this version does work with the packages.json.

Could you please try to reproduce this issue again?

I am experiencing the exact same problem using composer 1.9.3
It looks like the version constraint that the good people of firebearstudio are using, has become invalid as of composer 1.9.2.
See #https://github.com/composer/composer/issues/8527#issuecomment-574552473

The Magento docs mention that the latest stable version of composer should be used (at the moment that is 1.9.3) so as @ninarosemary asked: please retest using composer 1.9.3

At the moment I am using the https://repo-magento-mirror.fooman.co.nz as a workaround but I would prefer to use https://repo.magento.com

So, since this seems to be a bug which was fixed in composer, this should remain closed as there is nothing in Magento which can fix this.

@ninarosemary, @ainigma32: please talk to the folks from firebear, they should fix this bug, Magento can't fix it and Composer won't fix it.

Thanks!

@engcom-Hotel or @sdzhepa: can you talk to the people responsible for hosting the packages on repo.magento.com to search for that particular pattern where a range is being used as an alias, like 5.5.33 as ^5.2 in all packages on there?

And then to contact the maintainers of such packages, so they can fix that in a new version of their modules.

Thanks @hostep

Hello @ninarosemary @ainigma32 @hostep,

We confirm that the problem is on our side. Few of our first module versions contain composer alias which is not working with composer 1.9.2. Now we trying to contact people responsible for marketplace so they can disable those versions. I will be back to you as soon as I get a response from the marketplace.

I also have this issue, is there any update on this? @nikolaevas

Hello ,

I tried to create a workaround without getting composer version downgraded. Maybe it can help
here.

Thanks,
Vinay Shah

Was this page helpful?
0 / 5 - 0 ratings