Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer force install package ignore dependency versions

Tags:

I'd like to install reliese/laravel (https://github.com/reliese/laravel/) package into my Laravel 6+ project. reliese/laravel requires "illuminate/support": "~5.1", but my version is now 6+. I've looked thru the reliese/laravel package, and it should still work with 6+. How can I force composer to install this package? I've tried --ignore-platform-reqs and that did not work.

like image 985
solidau Avatar asked Oct 03 '19 20:10

solidau


1 Answers

From the composer docs on require

  • --ignore-platform-reqs: ignore php, hhvm, lib-* and ext-* requirements and force the installation even if the local machine does not fulfill these. See also the platform config option.

So the flag only ignores machine-specific requirements and not package version mismatch.

I would recommend forking the package on GitHub, manually change the version requirement like so

{
    "require": {
        "php": ">=5.6.4",
        "doctrine/dbal": "~2.5",
        "illuminate/support": "~6.0",
        "illuminate/database": "~6.0",
        "illuminate/contracts": "~6.0",
        "illuminate/filesystem": "~6.0",
        "illuminate/console": "~6.0"
    }
}

and instruct Composer to pull the package from the fork in your composer.json

"require": {
    "reliese/laravel": "master",
},
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/juventus18/laravel"
    }
]
like image 98
Salim Djerbouh Avatar answered Sep 27 '22 23:09

Salim Djerbouh