Globally installed composer packages don't run

589 Views Asked by At

When I read instructions for global composer packages (ie. PsySH), they makes it sound like you can just do

composer g require psy/psysh:@stable

and then

psysh

and so on for other such packages. Laravel is another one I have tried. ANyway, all I get when I try to run the tool is

'psysh' is not recognized as an internal or external command, operable program or batch file.

I didn't see the composer bin path in the PATH variable, so I added %APPDATA%/Composer/vendor/bin, where all the .bat files are for the globally installed packages, and I verified that the path works. Yet these tools won't run unless I am in the same bin directory as them. Anywhere else I get the error above...

1

There are 1 best solutions below

0
On

Well that was silly. It didn't like the %APPDATA% part of the path, even though other paths use environment variables just fine. I replaced it with C:\Users\MND\AppData\Roaming\Composer\vendor\binand then it works.