CakePHP 4.x Authentication 2.x - 安装失败。您的要求无法解决为一组可安装的软件包

Posted

技术标签:

【中文标题】CakePHP 4.x Authentication 2.x - 安装失败。您的要求无法解决为一组可安装的软件包【英文标题】:CakePHP 4.x Authentication 2.x - Installation failed. Your requirements could not be resolved to an installable set of package 【发布时间】:2021-12-14 04:22:44 【问题描述】:

我正在尝试安装 Cakephp 4.x Authentication 2.x,但是当我尝试运行此命令时出现此错误

作曲家需要“cakephp/authentication:^2.0”

Your requirements could not be resolved to an installable set of packages.
  Problem 1
    - Root composer.json requires cakephp/authentication 2.0 -> satisfiable by cakephp/authentication[2.0.0].
    - cakephp/authentication 2.0.0 requires zendframework/zend-diactoros ^2.0 -> satisfiable by zendframework/zend-diactoros[2.0.0, ..., 2.2.1].
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.2.1.
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.2.0.
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.1.5.
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.1.4.
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.1.3.
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.1.2.
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.1.1.
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.1.0.
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.0.3.
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.0.2.
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.0.1.
    - laminas/laminas-diactoros 2.8.0 conflicts with zendframework/zend-diactoros 2.0.0.
    - cakephp/cakephp 4.2.10 requires laminas/laminas-diactoros ^2.2.2 -> satisfiable by laminas/laminas-diactoros[2.8.0].
    - cakephp/cakephp is locked to version 4.2.10 and an update of this package was not requested.


Installation failed, reverting ./composer.json and ./composer.lock to their original content.

【问题讨论】:

为什么要 2.0 版?当前是2.6版。只需 composer require cakephp/authentication 就可以给你吗? 5 美元,您正在使用 Powershell。 【参考方案1】:

正如 Greg Schmidt 所说,cakephp 身份验证的最新版本是 2.6 版。所以我只是通过运行安装了最新版本

composer require "cakephp/authentication:^2.6"

【讨论】:

以上是关于CakePHP 4.x Authentication 2.x - 安装失败。您的要求无法解决为一组可安装的软件包的主要内容,如果未能解决你的问题,请参考以下文章

CakePHP 4.x Authentication 2.x - 安装失败。您的要求无法解决为一组可安装的软件包

CRT解决ssh远程登陆解决Unable to authenticate using any of the configured authenticatio

markdown [cakephp:CakePHP3注意事项] CakePHP3基本知识说明。 #cakephp

php [cakephp:Paginator示例] CakePHP上PaginatorComponent的示例代码。 #cakephp

php [cakephp:mysqldump] mysqldumpのcakephp実装サンプル。#php #cakephp #mysql

ORM如何在CakePHP3中运行