Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Composer Won't Update/Install

I recently changed 2 lines in a view and pushed the code to github. When I deployed on Laravel Forge (After about 2 weeks of no updates) & I got the following error:

"error":{
    "type":"ErrorException",
    "message":"Declaration of Illuminate\\View\\Engines\\CompilerEngine::handleViewException() should be compatible with Illuminate\\View\\Engines\\PhpEngine::handleViewException($e)",
    "file":"\/home\/forge\/default\/vendor\/laravel\/framework\/src\/Illuminate\/View\/Engines\/CompilerEngine.php",
    "line":100
}

I can’t even do php artisan -v without getting that error. I then ran composer diagnosis and got:

Checking composer.json: FAIL
require.damianromanowski/simplecdn : unbound version constraints (dev-master) should be avoided
require.roumen/feed : unbound version constraints (dev-master) should be avoided
require.themonkeys/error-emailer : unbound version constraints (dev-master) should be avoided
require.abodeo/laravel-stripe : unbound version constraints (dev-master) should be avoided
require.mattbrown/laracurl : unbound version constraints (dev-master) should be avoided
require.themonkeys/cachebuster : unbound version constraints (dev-master) should be avoided
Checking platform settings: FAIL
The xdebug extension is loaded, this can slow down Composer a little.
Disabling it when using Composer is recommended, but should not cause issues beyond slowness.
Checking git settings: OK
Checking http connectivity: OK
Checking disk free space: OK
Checking composer version: OK

How would I make that error go away? Never seen it before and not exactly sure what's wrong.

like image 929
MCG Avatar asked Sep 17 '14 04:09

MCG


People also ask

Why is composer not installing?

Try clearing Composer's cache by running composer clear-cache . Ensure you're installing vendors straight from your composer. json via rm -rf vendor && composer update -v when troubleshooting, excluding any possible interferences with existing vendor installations or composer.

How do I update composer to latest version?

To update Composer itself to the latest version, run the self-update command. It will replace your composer.phar with the latest version. If Composer was not installed as a PHAR, this command is not available. (This is sometimes the case when Composer was installed by an operating system package manager.)

Does composer update also install?

When you run composer update command it simply process the composer. json file and install dependencies, And creates the composer. lock file with updated dependencies. It does not process the composer.


2 Answers

Courtesy of AndreasLutro in #laravel:

Try to remove bootstrap/compiled.php.

That fixed it for me.

like image 152
tomvo Avatar answered Dec 11 '22 19:12

tomvo


The proper way to fix this is to run php artisan clear-compiled before running composer install or composer update

You can add the following to your composer.json in the "scripts" section if you want, to make it automatic:

"pre-install-cmd" :[
    "php artisan clear-compiled"
],
"pre-update-cmd": [
    "php artisan clear-compiled"
],
like image 33
Tom Macdonald Avatar answered Dec 11 '22 20:12

Tom Macdonald