【Composer】:Your requirements could not be resolved to an installable set of packages._composer your requirements could not be resolved t-程序员宅基地

技术标签: 常见错误库  composer  

错误内容

vagrant@homestead:/usr/share/nginx/html/laravel-blog$ sudocomposerinstall
Loadingcomposerrepositorieswithpackage information
Installingdependencies (includingrequire-dev) fromlockfile
Yourrequirementscouldnot beresolvedto aninstallablesetofpackages.
  Problem 1
    - Installationrequestfor doctrine/instantiator 1.0.3 -> satisfiablebydoctrine/instantiator[1.0.3].
    - doctrine/instantiator 1.0.3 requiresphp ~5.3 -> yourPHPversion (7.0.3) doesnot satisfythatrequirement.
  Problem 2
    - doctrine/instantiator 1.0.3 requiresphp ~5.3 -> yourPHPversion (7.0.3) doesnot satisfythatrequirement.
    - phpunit/phpunit-mock-objects 2.3.0 requiresdoctrine/instantiator ~1.0,>=1.0.1 -> satisfiablebydoctrine/instantiator[1.0.3].
    - Installationrequestfor phpunit/phpunit-mock-objects 2.3.0 -> satisfiablebyphpunit/phpunit-mock-objects[2.3.0].

原因

提示我的PHP 7版本太高,不符合composer.json需要的版本,但是在PHP 7下应该也是可以运行的,composer可以设置忽略版本匹配

解决方法

composer install --ignore-platform-reqs
or
composer update --ignore-platform-reqs

再次执行composer命令,就可以正常运行了

特殊情况

当前我使用的镜像,设置的是阿里云镜像。
拉取新项目后,更新失败后,通过以上方式进行解决问题。
操作依旧失败,错误内容如下:

执行添加

E:\phpstudy_pro\WWW\yuxiang-php>composer install --ignore-platform-reqs
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires topthink/framework, it could not be found in any version, there may be a typo in the package name.
  Problem 2
    - Root composer.json requires topthink/think-image, it could not be found in any version, there may be a typo in the package name.
  Problem 3
    - Root composer.json requires topthink/think-captcha, it could not be found in any version, there may be a typo in the package name.

执行更新

E:\phpstudy_pro\WWW\yuxiang-php>composer update --ignore-platform-reqs
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires topthink/framework, it could not be found in any version, there may be a typo in the package name.
  Problem 2
    - Root composer.json requires topthink/think-image, it could not be found in any version, there may be a typo in the package name.

解决办法

重新核对项目程序后,拿去其他项目composer.json进行更新,可以正常更新。
比较其他项目composer.json与新项目的composer.json进行对比
发现新项目的composer.json下多出已下内容,删除后,重新更新,正常拉取内容。

    "repositories": {
    
        "packagist": {
    
            "type": "composer",
            "url": "https://packagist.phpcomposer.com"
        }
    }

查询相关composer配置后,发现这里设置的是国内镜像。
重新设置本地composer源地址为以上国内镜像,重新测试,发现问题依旧。
删除上面部分内容,更新正常。

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/weixin_45792959/article/details/118497081

智能推荐

USTC计算数论课程学习记录_连分数因子分解-程序员宅基地

文章浏览阅读1.4k次,点赞4次,收藏13次。文章目录1 大整数因子分解算法1.1 连分数因子分解1.2 二次筛法1.3 数域筛法1.4 Pollard ρ1.5 Pollard p-11.6 P+1算法1.7 椭圆曲线法2 离散对数2.1 小步大步法2.2 Silver-Hellman-Pholig3 模p开平方计算数论学习记录,如有错误,欢迎评论区指正。1 大整数因子分解算法寻找x2≡y2 (mod p)x^2\equiv y^2\ (mod\ p)x2≡y2 (mod p)来分解N。连分数、二次_连分数因子分解

数据结构 图 最短路径-程序员宅基地

文章浏览阅读199次。(1)从某个源点到其余各顶点的最短路径Dijkstra的代码如下:头文件:#defineINFINITY10000#defineMAX_VERTEX_NUM20typedefintInfoType;typedefcharVertexType;typedefintVRType;typedefenum...{DG,DN,UDG,UDN}GraphKind;typedefstructA..._please input the number of vertex n

mysql主备配置文件 my.cnf_my.cnf配置的server_id-程序员宅基地

文章浏览阅读5.5k次。主:[mysqld]lower_case_table_names=1datadir=/mnt/mysql/datasocket=/mnt/mysql/mysql.socklog-error=/mnt/mysql/log/mysqld.logpid-file=/mnt/mysql/mysqld.pidwait_timeout=2147483interactive_timeout=2147483character_set_server=utf8init_connect='SET._my.cnf配置的server_id

堆排序(c语言)_堆排序加入一个节点-程序员宅基地

文章浏览阅读278次,点赞10次,收藏7次。堆排序的效率在各种排序中有比较高的效率,时间复杂度为O(nlog2n)_堆排序加入一个节点

sqoop import hbase by kerberos安全认证下_sqoop 脚本添加kerbores认证-程序员宅基地

文章浏览阅读515次。2020-07-15 16:30:47,365 ERROR tool.ImportTool: Encountered IOException running import job: java.io.IOException: Can't get Master Kerberos principal for use as renewer at org.apache.hadoop.mapreduce.security.TokenCache.obtainTokensForNamenodesIntern_sqoop 脚本添加kerbores认证

ubuntu sublime支持中文_ubuntu sublim 中文字体-程序员宅基地

文章浏览阅读779次。1. 安装fcitx中文输入法或sougou拼音输入法 * `sudo apt-get install fcitx-pinyin` * sougou + `sudo add-apt-repository ppa:fcitx-team/nightly` + `sudo apt-get update` 添加软件源,在使用之前要先更新_ubuntu sublim 中文字体

随便推点

Ubuntu apt/apt-get安装sqliteman出现“E: 无法定位软件包”解决方案_无法定位软件包 sqliteman-程序员宅基地

文章浏览阅读2.9k次,点赞4次,收藏5次。前提:python初学者。自学过程中发现很多网上没有说清楚的解决方案,因此自己记录下来。老师让安装sqliteman:sudo apt install sqliteman提示:E: 无法定位软件包 sqliteman看网上主要是两种解决方案:1.换源。尝试后再安装还是同样的问题。2.第二种方式如下图:尝试了还是无法解决https://blog.csdn.net/Z_YMing/article/details/95041427男朋友是程序员,问了他以后,说让我先安装sqlite1/安装sqli_无法定位软件包 sqliteman

大学c语言第三章作业,c语言程序设计一章部分和第三章习题答案.doc-程序员宅基地

文章浏览阅读126次。c语言程序设计一章部分和第三章习题答案实 验 报 告课程名称 C语言程序设计A实验项目 编程环境认知与顺序程序设计实验仪器 PC机一台学 院_____信息管理学院_______专 业 信息管理与信息系统班级/学号 信管1302班学生姓名 吴玉元实验日期 2014年3月成 绩 _________________..._中国大学c语言程序设计单元测试第三章答案

Qt Charts 之 QChartView Class_qt class : public qchartview-程序员宅基地

文章浏览阅读7k次。详细描述QChartView是一个独立的图标小部件。QChartView是一个独立的可以显示图表的部件。它不需要分离的QGraphicsScene就可以工作。如果你想要在已经存在的QGraphicsScene中显示一个图表,你需要使用QChart(或者QPolarChart)类(来替代QChartView)。成员函数(API)QChartView::QChartVi_qt class : public qchartview

网络安全防护体系建设-程序员宅基地

文章浏览阅读8.9k次,点赞2次,收藏47次。构建适应数字化时代的网络安全防护体系,通过建立信任实现数字化业务的连接,通过控制风险抵御连接过程中的威胁,基于风险与信任的控制,保障网络安全防护体系落地。_网络安全防护体系

C语言—函数的引用_c语言引用函数-程序员宅基地

文章浏览阅读4k次。1.函数的定义 2.函数的返回语句 3.函数参数的应用 4.函数的调用_c语言引用函数

DA14531_写晶振校准值(xtrim)到OTP_14531 otp烧录-程序员宅基地

文章浏览阅读1.2k次。531写晶振校准值到OTP中开发过580/585的用户应该知道,想要将晶振校准值烧录到OTP中,我们只需往芯片的OTP Header中的某个固定的位置烧录一个两个字节的值即可。531的情况不太一样。DA14531的OTP Header分成了两部分: Configuration Script和Main group:其中,Main group存放一些常用的配置如:SPI FLASH 引脚,蓝牙 MAC 地址,时间戳等;特定的OTP位置位置,有其特定的含义。Configuration Script提供了比_14531 otp烧录