You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Magento 2.4.4安装时Composer报错:laminas/laminas-dependency-plugin安装失败

解决Magento 2.4.4安装时laminas/laminas-dependency-plugin的Git checkout错误

我之前安装Magento 2.4.x版本时遇到过一模一样的问题!这个报错本质是Composer尝试拉取的Git commit哈希值73cfb63ddca9d6bfedad5e0a038f6d55063975a3不存在,或是本地缓存、依赖信息异常导致的,试试下面这些修复步骤:

  • 清除Composer本地缓存
    缓存里可能存储了失效的依赖引用,先清理掉:

    composer clear-cache
    
  • 移除旧的依赖文件
    项目根目录的vendor文件夹和composer.lock文件可能已经保存了错误的依赖快照,删除它们重新生成:

    rm -rf vendor composer.lock
    
  • 强制指定laminas依赖的稳定版本
    有时候Composer会尝试拉取不稳定的commit,直接指定一个稳定版本安装:

    composer require laminas/laminas-dependency-plugin:^2.1 --no-update
    composer update
    

    或者在安装Magento的时候直接带上这个参数:

    composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.4.4 . --with laminas/laminas-dependency-plugin:^2.1
    
  • 检查Composer源与网络连通性
    如果使用了第三方Composer镜像,可能存在同步延迟的问题,切换到官方源试试:

    composer config repo.packagist composer https://repo.packagist.org
    

    同时确保你的服务器能正常访问GitHub(laminas的包托管在GitHub),可以用克隆命令测试:

    git clone https://github.com/laminas/laminas-dependency-plugin.git
    

    如果克隆失败,需要排查网络防火墙或者代理设置。

  • 手动兜底安装(如果以上都不行)
    直接克隆laminas-dependency-plugin仓库到项目的vendor/laminas目录下,切换到一个稳定的标签版本(比如v2.1.0):

    cd vendor/laminas
    git clone https://github.com/laminas/laminas-dependency-plugin.git
    cd laminas-dependency-plugin
    git checkout v2.1.0
    

    之后再执行composer dump-autoload更新自动加载文件。

内容的提问来源于stack exchange,提问作者Ajith

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 01:47:36