Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer --> Package listed for update is not installed, ignoring

I am using Laravel 5.1 and trying to install a new package via composer. I am using following command.

composer require "matriphe/imageupload:5.1.*"

I am getting following error.

./composer.json has been updated
> php artisan clear-compiled
Package "matriphe/imageupload" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
> php artisan optimize
Generating optimized class loader

I also tried running

composer self-update

This is the message I received.

You are already using composer version f1aa655e6113e0efa979b8b09d7951a762eaa04c.

I have also tried updating composer dependencies for project via manually adding package name to composer.json and running.

composer update

and partially updating via.

composer update "matriphe/imageupload:5.1.*"

Up until now I have installed other packages and all of them were installed except this one.

like image 322
Anfal Avatar asked Sep 26 '22 22:09

Anfal


2 Answers

For me, it was simply a typo in the package name.

like image 117
dockerdock Avatar answered Sep 30 '22 07:09

dockerdock


Update: I solved the issue in the most bizzare way possible.

I initially had following composer.json file when I ran the command

composer require "matriphe/imageupload:5.1.*"

and

composer require laravelcollective/html:~5.0

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "matriphe/imageupload": "5.1.*",
        "laravelcollective/html": "~5.0"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

And got the error.

Package "matriphe/imageupload" listed for update is not installed. Ignoring.

and

Package "laravelcollective/html" listed for update is not installed. Ignoring

To solve it I manually added another require array in json added packages to be installed which is given below.

"require": {
    "laravelcollective/html": "~5.0",
    "matriphe/imageupload": "5.1.*"
}

My modified composer.json file look like this.

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*"
    },

    "require": {
        "laravelcollective/html": "~5.0",
        "matriphe/imageupload": "5.1.*"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "pre-update-cmd": [
            "php artisan clear-compiled"
        ],
        "post-update-cmd": [
            "php artisan optimize"
        ],
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

and ran the following command.

composer update

It did the trick for me.

like image 25
Anfal Avatar answered Sep 30 '22 07:09

Anfal