Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to solve the problem of composer installing composer package reporting Your requirements could not be resolved

Shulou Source: shulou.com Published: 2022-06-02 13:56:10 10月03日 Update

This article mainly introduces how to solve the composer installation composer package Your requirements could not be resolved, the article is very detailed, has a certain reference value, interested friends must read it!

One: encountered Your requirements could not be resolved to an installable set of packages when installing composer package using composer

Analysis:

This is because version 1.1.0 of doctrine/instantiator must be PHP7.1, but my PHP environment is PHP7.0.12, but I found a problem. There is no doctrine/instantiator package information in my composer.json file, so why report such an error?

At this time, I found vendor/doctrine/instantiator and found that the doctrine/instantiator package had been installed in my framework. I opened the composer.json file in the vendor/doctrine/instantiator directory and found that the environment needed for this package was PHP7.1:

Find the address of the doctrine/instantiator package: https://packagist.org/package...

At this time, I found that the PHP environment required for version 1.1.0 of doctrine/instantiator is 7.1, so I wonder if the installation of the composer package in this framework failed because the version of the doctrine/instantiator package in my framework is 1.1.0?

Resolve:

1: change the version of the doctrine/instantiator package to the version we need (here I change the version of the doctrine/instantiator package to 1.0.x-dev)

Composer require doctrine/instantiator "1.0.x-dev"

2: change the doctrine/instantiator package to the required version, and then install the composer package you need. At this time, the error will not be reported (let me take the huaweichenai/baidu-discern package as an example)

This is a successful installation using composer.

There is a method on the Internet: use the composer install-- ignore-platform-reqs command to set to ignore version matching and then install the composer package you need. After testing, I found that there was still an error, but the specific reason is not clear. If you know why, you are welcome to leave a message to tell the blogger.

The above is all the contents of this article "how to solve composer installation composer package Your requirements could not be resolved", thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Tags: Version framework environment content file method article this is error clarity success value information interest command address buddy partner more directory Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Docker Apple Microsoft Shulou Tech Info