If I run psalm --version in a directory that contains a composer.json, but without a respective vendor/autoloader.php, Psalm will spit out an error. A workaround seems to be to run psalm --version within a fresh directory. For example:
repo$ psalm --version
Could not find any composer autoloaders in /repo
Add a --root=[your/project/directory] flag to specify a particular project to run Psalm on.
repo$ cd $(mktemp -d)
tmp.YQhKg9ZiiV$ psalm --version
Psalm 5.26.1@d747f6500b38ac4f7dfc5edbcae6e4b637d7add0
I understand why Psalm can't work without autoloaders, but --version should not be subject to this restriction.
Hey @Xophmeister, can you reproduce the issue on https://psalm.dev? These will be used as phpunit tests when implementing the feature or fixing this bug.
If I run
psalm --version
in a directory that contains acomposer.json
, but without a respectivevendor/autoloader.php
, Psalm will spit out an error. A workaround seems to be to runpsalm --version
within a fresh directory. For example:I understand why Psalm can't work without autoloaders, but
--version
should not be subject to this restriction.