- ๐บ๐ธUnited States COBadger
In my case this issue was resolved by removing my vendor directory and `composer install`-ing again.
Thanks @COBadger & @cslevy in both cases your answers work, is there something we can do (maybe just linking to this issue) that can help reduce any time for future people searching for a fix?
- ๐ฌ๐ทGreece tarasiadis
hi
i confirm that #6 also solved my casethanks to @cslevy
- ๐ฎ๐ณIndia varun pradeep
Hi
@ cslevy In my case there was no composer.json file in web folder, so i have tried @COBadger "composer install" command. It didn't resolved my issue.
i have researched more and found out 2 commands which resolved my issue
composer require --dev palantirnet/drupal-rector --with-all-dependencies
composer require drupal/upgrade_status --update-with-all-dependenciesThanks
- ๐ฏ๐ฒJamaica axle_foley00
I had the same issue and am confirming that I had a stray
composer.json
file in theweb
folder. Once that was removed the error disappeared. - Status changed to Active
4 months ago 9:27am 7 July 2024 - ๐ญ๐บHungary Gรกbor Hojtsy Hungary
How do people end up with an empty
composer.json
at the wrong place? I believe this is the error message you all are hitting:throw new \Exception('The PHPStan binary was not found in the default vendor directory based on the location of ' . $composer_json_path . '. You may need to configure a vendor-dir in composer.json. See https://getcomposer.org/doc/06-config.md#vendor-dir. Attempted: ' . $binPath . '/phpstan.');
We can probably refine this text to say something like this?
The PHPStan binary was not found in the default vendor directory based on the location of ' . $composer_json_path . '. Is this the right composer.json file? If it is, you may need to configure a vendor-dir in composer.json....
I am not clear if it could be a valid case that we found a composer.json file that should not be deleted but is still not the right composer.json file. Could that happen? (I would avoid suggesting you remove useful composer.json files, if that were the case).
- ๐ฏ๐ฒJamaica axle_foley00
@Gรกbor Hojtsy
So in my case I had a team member who accidentally tried to run the composer command in the
web
directory instead of the directory above and when it complained about a composer.json file being missing then they ended up adding a new composer.json file there. So once I realized and cleared that up with them we removed the incorrect one.I do believe the changes to the message you suggested could help to point future users in the right direction though. I also agree we shouldn't suggest removing other composer.json files that might be legitimately be added by users.