Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command "clear-compiled" is not defined. Laravel 5.2

I am trying to download Laravel HTML dependencies with Composer.

composer.json is here:

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

And when I run composer update or php composer update, the terminal log is:

E:\xampp\htdocs\lara-test>composer update
> php artisan clear-compiled

  [InvalidArgumentException]
  Command "clear-compiled" is not defined.

Script php artisan clear-compiled handling the pre-update-cmd event returned with 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] [-i|--interactive] [--] [<packages>]...

What is missing? Please help.

like image 253
Jitendra Avatar asked Apr 09 '16 08:04

Jitendra


1 Answers

You can get around this by using composer update --no-scripts which runs the update command from composer without the executing the scripts defined in the composer.json file.

As part of running composer update a script is executed which runs php artisan clear-compiled - effectively the update works as normal, just without compiled files being cleared.

There's a couple of blog posts on other work arounds: http://jianjye.com/fix-command-clear-compiled-not-defined-error-upgrading-laravel-5-2/ and an issue logged https://github.com/laravel/framework/issues/9678

like image 143
James Avatar answered Oct 31 '22 13:10

James