Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer update not working to update laravel dependencies

When I try to run composer update, I get the following error:

[RuntimeException]
Error Output: '$_' is not recognized as an internal or external command,
operable program or batch file.

I am not sure why this happens, but I have tried updating composer itself (which runs successfully) and it does not work. Composer usually works just fine, so I am a little bit confused.

Added composer file:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "require": {
        "laravel/framework": "4.1.*",
        "bogardo/mailgun": "dev-master"
    },
    "autoload": {
        "classmap": [
            "app/commands",
            "app/controllers",
            "app/models",
            "app/database/migrations",
            "app/database/seeds",
            "app/tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-install-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "php artisan clear-compiled",
            "php artisan optimize"
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ]
    },
    "config": {
        "preferred-install": "dist"
    },
    "minimum-stability": "stable"
}
like image 519
David Mckee Avatar asked Jan 23 '26 12:01

David Mckee


2 Answers

I seem to have solved my problem. I need to keep the scripts because it powers my deployment. I needed to run composer update --no-scripts and it worked perfectly.

like image 57
David Mckee Avatar answered Jan 25 '26 00:01

David Mckee


I think the problem is located in your code. Try to run

php artisan

if the error gets thrown also it is a problem in your code.

composer

fails also because in the

scripts

section you run php artisan.

like image 37
lkoenigsberger Avatar answered Jan 25 '26 01:01

lkoenigsberger



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!