Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

peanut's avatar

composer update (php artisan clear-compiled) error

This is what is happening when I run composer update in my root directory:

Halichu@HALICHU-PC /c/Source/ventrac (master)
$ composer update
> php artisan clear-compiled
"forms"
Script php artisan clear-compiled handling the pre-update-cmd event returned wit
h an error



  [RuntimeException]
  Error Output:



update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock]
 [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-
progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]
 [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--pre
fer-lowest] [packages1] ... [packagesN]

I don't understand this error. This is what my composer looks like:

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "illuminate/html": "5.*",
        "ventrac/cms": "dev-master",
        "ventrac/cmsforms": "dev-master"
    },
    "repositories": [{
        "type": "git",
        "url": "ssh://git@svn:7999/vp/cms.git"
    }, {
        "type": "git",
        "url": "ssh://git@svn:7999/vp/cmsforms.git"
    }],
    "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/",
            "Ventrac\\CMS\\": "packages/Ventrac/CMS/src",
            "Ventrac\\CMSForms\\": "packages/Ventrac/CMSForms/src"
        },
        "files": ["app/Http/helpers.php"]
    },
    "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"
    }
}

I even got rid of the packages I'm developing and tried to run it again, but it's still outputting this error.. I don't get why it's echoing "forms" out into it.

Thanks for any help.

0 likes
3 replies
peanut's avatar

Seemed like the error was because I had the service provider of the second package in there before I installed it. Woops!

willvincent's avatar

composer update --no-scripts

Alternatively, you could move the pre-update-cmd item to the first item in the post-update-cmd list in your composer.json file.

Please or to participate in this conversation.