Home  >  Article  >  Development Tools  >  Solve the composer installation composer package report Your requirements could not be resolved

Solve the composer installation composer package report Your requirements could not be resolved

藏色散人
藏色散人forward
2021-02-22 14:23:564519browse

The tutorial column of composer will introduce you to composer installation and composer package reporting. Your requirements could not be resolved. I hope it will be helpful to friends in need!

1: When using composer to install composer packages, Your requirements could not be resolved to an installable set of packages
Solve the composer installation composer package report Your requirements could not be resolved

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:
Solve the composer installation composer package report Your requirements could not be resolved

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)
Solve the composer installation composer package report Your requirements could not be resolved

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
Solve the composer installation composer package report Your requirements could not be resolved

The above is the detailed content of Solve the composer installation composer package report Your requirements could not be resolved. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:segmentfault.com. If there is any infringement, please contact admin@php.cn delete