Class 'Monolog\\Logger' not found, install

2020-07-18 04:37发布

问题:

I installed Laravel without using composer with typing this command:

C:\wamp\www\travail>laravel new project

It seems that it is on the good way.

Creating application...

Application ready! Build something amazing.

But when I tried to open my project here:

wamp-->localhost-->travail-->project-->public

I got this error:

Class 'Monolog\Logger' not found

回答1:

I solve this issue by doing the following:

  1. Check the minimum-stability value in composer.json and set it to stable:

    "minimum-stability": "stable"
    
  2. Update you composer:

    composer self-update
    
  3. Re-run composer udpate:

    composer update
    

Then run any artisan commands and enjoy coding!



回答2:

According to this thread. Change minimum-stability from dev to stable in composer.json, then run an update. Also try to do a dump-autoload.



回答3:

Finally it works for me after running these two commands:

composer self-update

Then:

composer update --no-scripts