2

I am trying to run composer update or if I tried to install any package for my site it hangs saying this

Loading composer repositories with package information
Updating dependencies (including require-dev)

But If I try composer install it is working with

Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing psr/log (1.1.2): Loading from cache
- Installing symfony/polyfill-ctype (v1.13.1): Loading from cache
- Installing phpoption/phpoption (1.6.0): Loading from cache
......

I am using Laravel Homestead with vagrant and virtualbox

Whats the problem and How to solve it

Madhuri Patel
  • 1,270
  • 12
  • 24
xenex-media
  • 173
  • 1
  • 15

2 Answers2

1

composer is still hanging try to clear composer cache:

composer clear-cache

If these steps does not repair your composer then it's possible that the system does not have enough RAM memory available

Increase memory https://stackoverflow.com/a/44533437/3518053 or

Generate swap file .Try creating a swap file to provide more memory

albus_severus
  • 3,626
  • 1
  • 13
  • 25
1

I had this issue a few times. Composer install is mostly working becuase it doesn't have to check every package for updates. To fix this a few options you can try :

  • update composer to latest
  • remove the complete vendor folder and run composer update
  • increase ram memory (most times it fails because of this). Check out this Q Composer update memory limit
  • Check you composer.json file for unnecessary package depths, some packages require other packages wich can overload your cpu and ram.
  • Try composer update --prefer-dist
Wim Pruiksma
  • 588
  • 5
  • 19