1: When using composer to install composer packages, Your requirements could not be resolved to an installable set of packages
Analysis:
This is Since the 1.1.0 version of doctrine/instantiator must be PHP7.1, however, 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 is such a report returned? What about errors?
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 required for this package is PHP7. 1:
Find the address of doctrine/instantiator package: https://packagist.org/package...
At this time, I found doctrine/instantiator 1.1.0 The PHP environment required for the version 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?
Solution:
1: Change the version of doctrine/instantiator package to the version we need (here I change the version of 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, errors will not be reported (here I 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 ignore version matching and then install it The composer package you need. After testing this method, I found that it still reported an error. I don’t know the specific reason. If you know the reason, please leave a message and tell the blogger