I noticed a problem when install my laravel project . I have done this several times without problem but this particular time i wanted to move to a new computer so i pull an updated copy of my project from github, ran "composer install", the installation broke around this stage

Writing lock file
Generating autoload files
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class
'Monolog\\Logger' not found","file":"C:\\personal\\questack\\vendor\\laravel\\framewo
rk\\src\\Illuminate\\Log\\LogServiceProvider.php","line":23}}{"error
:{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Monolog\\Logger' not  found","file":"C:\\personal\\questack\\vendor\\laravel\\framework\\src\\Illuminate\\Log\\LogServiceProvider.php","line":23}}Script php artisan clear-compiled handling the post-install-cmd event returned with an error,

Anyone know why this is happening?

有帮助吗?

解决方案

In your composer.json, change

"minimum-stability": "dev"

to

"minimum-stability": "stable"

Additionally, update your composer with self updater.

php composer.phar self-update

The reason is, Monolog uses PSR-4 autoloading but old versions of composer doesn't know how to load PSR-4.

This should solve your issue.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top