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

全局安装emmajiugo/flutterwave-cli时Composer依赖冲突求助

Fixing Illuminate/Container Version Conflict When Installing emmajiugo/flutterwave-cli Globally

Let's break down what's happening and how to fix this dependency conflict issue:

The Root Problem

When running composer global require emmajiugo/flutterwave-cli, Composer throws a conflict because:

  • Your global Composer environment has illuminate/container v5.8.28 locked in
  • The v1.3 version of your package requires laravel-zero/framework ^7.0, which in turn needs illuminate/container ^7.0

Notably, the composer.json you shared specifies laravel-zero/framework ^5.8—this suggests a mismatch between what's published on Packagist for v1.3 and your local codebase. You likely updated the framework version for v1.3 but forgot to push the updated composer.json to your repo (or Packagist didn't sync the changes).


Step 1: Fix Your Package's Dependencies

First, align your package's composer.json with the version of Laravel Zero you intend to use for v1.3:

If you want v1.3 to use Laravel Zero 7.x:

Update the require and require-dev sections to match the framework's requirements:

{
  // ... other fields
  "require": {
    "php": "^7.3|^8.0", // Laravel Zero 7.x requires PHP 7.3+
    "laminas/laminas-text": "^2.7",
    "laravel-zero/framework": "^7.0",
    "padraic/phar-updater": "^1.0.6",
    "vlucas/phpdotenv": "^4.0",
    "yuloh/open": "^0.1.0"
  },
  "require-dev": {
    "mockery/mockery": "^1.4",
    "phpunit/phpunit": "^9.0" // Compatible with Laravel Zero 7.x
  },
  // ... other fields
}

If you want to keep using Laravel Zero 5.8 for v1.3:

Ensure the v1.3 tag on your GitHub repo points to code with the ^5.8 framework constraint, and consider creating a separate branch (e.g., 7.x) for the Laravel Zero 7.x upgrade, publishing it as a new version (like v1.4) to avoid confusing users.


Step 2: Resolve the Global Installation Conflict

For users (including yourself) facing the global dependency conflict, try these workarounds:

  • Force dependency update (use with caution)
    This will update conflicting global packages to compatible versions, but may affect other globally installed tools:

    composer global require emmajiugo/flutterwave-cli --with-all-dependencies
    
  • Install locally instead of globally
    Avoid impacting your global environment by installing the CLI in a dedicated directory:

    mkdir flutterwave-cli && cd flutterwave-cli
    composer require emmajiugo/flutterwave-cli
    # Run commands with ./vendor/bin/flutterwave
    
  • Clean cache and reinstall
    Clear Composer's global cache and remove the conflicting package first:

    composer global clear-cache
    composer global remove illuminate/container
    composer global require emmajiugo/flutterwave-cli
    

Step 3: Sync Changes to Packagist

After updating your composer.json and pushing changes to GitHub, head to your package's Packagist page and click the Update button to ensure the latest dependency constraints are reflected.

For long-term maintainability, consider using branch-based versioning:

  • Maintain a 5.8 branch for Laravel Zero 5.8 compatible releases (v1.2.x)
  • Use a 7.x branch for Laravel Zero 7.x compatible releases (v1.3.x+)

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.08 15:22:44