Laravel-medialibrary: I couldn't install this package with Laravel 5.7.*

Created on 1 Oct 2018  路  24Comments  路  Source: spatie/laravel-medialibrary

Composer throws this message:

Problem 1
    - Installation request for spatie/laravel-medialibrary 7.0.0 -> satisfiable by spatie/laravel-medialibrary[7.0.0].
    - Conclusion: remove laravel/framework v5.7.6
    - Conclusion: don't install laravel/framework v5.7.6
    - spatie/laravel-medialibrary 7.0.0 requires illuminate/pipeline ~5.5.0|~5.6.0 -> satisfiable by illuminate/pipeline[5.5.x-dev, 5.6.x-dev, v
5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.6.0, v5.6.1, v5.6.
10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.2
6, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.4, v5.6.5, v5.6.6, v
5.6.7, v5.6.8, v5.6.9].
    - don't install illuminate/pipeline 5.5.x-dev|don't install laravel/framework v5.7.6
.......
- Installation request for laravel/framework (locked at v5.7.6, required as 5.7.*) -> satisfiable by laravel/framework[v5.7.6].

How can I achieve the installation?

Most helpful comment

@dundermave as you mentioned, it works.

I guess the doc shoulnd't specify the version, just the name of the package as you did.

Thanks!

All 24 comments

yup, not able to install on 5.7.*

Working fine on : Laravel Framework 5.7.6
fine

Could you please post your composer.json content here !

Sure, this is my composer file:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": "^7.1.3",
        "fideloper/proxy": "^4.0",
        "laravel/framework": "5.7.*",
        "laravel/tinker": "^1.0",
        "yajra/laravel-datatables-oracle": "~8.0"
    },
    "require-dev": {
        "beyondcode/laravel-dump-server": "^1.0",
        "filp/whoops": "^2.0",
        "fzaninotto/faker": "^1.4",
        "mockery/mockery": "^1.0",
        "nunomaduro/collision": "^2.0",
        "phpunit/phpunit": "^7.0"
    },
    "autoload": {
        "classmap": [
            "database/seeds",
            "database/factories"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "extra": {
        "laravel": {
            "dont-discover": [
            ]
        }
    },
    "scripts": {
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ],
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ]
    },
    "config": {
        "preferred-install": "dist",
        "sort-packages": true,
        "optimize-autoloader": true
    },
    "minimum-stability": "dev",
    "prefer-stable": true
}

I solved it by installing this way:
composer require spatie/laravel-medialibrary

It installed me ^7.5 version and now everything works fine

@dundermave as you mentioned, it works.

I guess the doc shoulnd't specify the version, just the name of the package as you did.

Thanks!

I am also here stack with the same problem.

same problem heree help T_T

Gloudemans/shoppingcart not installing

@MdkanokHossain & @leonardolouie did you already tried to use the command @dundermave posted before??

@eichgi i use other package and its work now https://github.com/darryldecode/laravelshoppingcart

@eichgi .. i also try this "darryldecode" its work but "Gloudemans" not working .

This problem is not caused by this package.

Use prohibits to find out which package is the culprit of the problems: https://getcomposer.org/doc/03-cli.md#prohibits-why-not-

Your requirements could not be resolved to an installable set of packages.

Problem 1
- Conclusion: don't install beyondcode/laravel-websockets 1.1.1
- Conclusion: remove guzzlehttp/psr7 1.4.2
- Installation request for beyondcode/laravel-websockets ^1.1 -> satisfiable by beyondcode/laravel-websockets[1.1.0, 1.1.1].
- Conclusion: don't install guzzlehttp/psr7 1.4.2
- beyondcode/laravel-websockets 1.1.0 requires guzzlehttp/psr7 ^1.5 -> satisfiable by guzzlehttp/psr7[1.5.0, 1.5.1, 1.5.2, 1.5.x-dev].
- Can only install one of: guzzlehttp/psr7[1.5.0, 1.4.2].
- Can only install one of: guzzlehttp/psr7[1.5.1, 1.4.2].
- Can only install one of: guzzlehttp/psr7[1.5.2, 1.4.2].
- Can only install one of: guzzlehttp/psr7[1.5.x-dev, 1.4.2].
- Installation request for guzzlehttp/psr7 (locked at 1.4.2) -> satisfiable by guzzlehttp/psr7[1.4.2].

Installation failed, reverting ./composer.json to its original content.

As @dundermave has mentioned above, use the below code to install the latest package of the Laravel Media Library.

composer require spatie/laravel-medialibrary

Capture

still can't install it after install on laravel 5.7.28
composer require spatie/laravel-medialibrary

i have similar issue with installing socialite
composer require laravel/socialite
i need help please

Did you find a solution Tripletens?

Not yet

composer require spatie/laravel-medialibrary

Let me try this one

how can i solve this problem forlaravel-medialibrary ......

problem

ok found a hacky solution provided by @jstoone:
add this to your composer.json:

{
"require": {

  • "spatie/laravel-medialibrary": "^7.0.0"
    },
  • "provide": {
  • "ext-imagick": "*"
  • },
    "require-dev": {
}

}

@Towhid86 and others having similar problems, please make sure you have the imagick install and enabled.

Use the following to get information about the imagick extension:

php --re imagick

If the above command fails with a message similar to: Exception: Extension imagick does not exist, then it means you don't have the imagick extension installed/enabled.

Now you have two options:

  1. Install and enable the imagick extension in your dev environment.
    _There are plenty of resources on how to install and enable the extension for any OS you desire._
  2. To a new provides-key in your composer.json-file add ext-imagick to the list.
    _Have a look at https://github.com/spatie/laravel-medialibrary/issues/1553#issuecomment-528343947 for an example of the changes_

try this version from maennchen/zipstream-php
"maennchen/zipstream-php": " ^1.2",
work for me after every thing i tried

if you're trying to install it on Laravel 5.7, you should use an older version: composer require beyondcode/laravel-websockets:1.3

The latest (1.4) version only supports Laravel 5.8, 6.x and 7.x.

Was this page helpful?
0 / 5 - 0 ratings