简体   繁体   中英

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"
}

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.

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 .

try this command composer update --ignore-platform-reqs

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM