Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psalm --version fails on Composer projects without any autoloaders #11149

Open
Xophmeister opened this issue Nov 6, 2024 · 1 comment
Open

Comments

@Xophmeister
Copy link

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.

Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant