添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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?

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.

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.