Laravel-ide-helper: Composer memory exhausted when installing this package

Created on 23 May 2020  路  8Comments  路  Source: barryvdh/laravel-ide-helper

If I have this package installed I am unable to perform composer require commands.
composer update works fine.
If I remove the package I have no issues.

"barryvdh/laravel-ide-helper": "^2.6",
Laravel Framework 7.12.0
"php": "^7.4.4",

Error:

./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)         
PHP Fatal error:  Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes) in phar:///usr/local/bin/composer/src/Composer/DependencyResolver/RuleWatchGraph.php on line 52

Most helpful comment

You could also use an env var for ignoring this issue once
COMPOSER_MEMORY_LIMIT=-1 composer require --dev barryvdh/laravel-ide-helper

All 8 comments

I had a similar issue. Deleting the vendor folder and installing again fixed it for me.

Thank you for the suggestion. Tried it, but it did not help :)

I can't see how this is an issue with the package; if, it's a composer problem no?

Try the latest beta and see if it works => composer self-update --snapshot

I had similar memory issues with https://github.com/rebing/graphql-laravel and just changing this fixed the build on travis

You could also use an env var for ignoring this issue once
COMPOSER_MEMORY_LIMIT=-1 composer require --dev barryvdh/laravel-ide-helper

I think I was unclear when specifying my issue.
I have no problem installing this package.
But after it is installed I cannot install any other package without getting this error.
If I remove this package, I can install other packages without issues.

I can't see how this is an issue with the package; if, it's a composer problem no?

Try the latest beta and see if it works => composer self-update --snapshot

I had similar memory issues with https://github.com/rebing/graphql-laravel and just changing this fixed the build on travis

Tried this but I get a lot of symfony/thanks errors...

Since most people will scroll down to the bottom for the answer, I'll point you back up to this comment 猬嗭笍

You could also use an env var for ignoring this issue once
COMPOSER_MEMORY_LIMIT=-1 composer require --dev barryvdh/laravel-ide-helper

Nearly every time you hit a memory limit with composer, you can get around it by prefixing the command with COMPOSER_MEMORY_LIMIT=-1. You can find more information about this solution here: https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors

Thanks for the answers @squatto and @mash1t.

Was this page helpful?
0 / 5 - 0 ratings