Everywhere it says to 'Check that your path is right'. And yup - if you haven't done that, then you should start there. The easiest way is to go to your terminal and write:
echo $PATH
... And then you should see ~/.composer/vendor/bin
in between two colons in there. If that isn't there, then you should go to your ~/.bashrc
-file (or ~/.zshrc
-file) and add this line:
export $PATH=~/.composer/vendor/bin:$PATH
And then it may be fixed.
My problem had deeper roots, though. Even though my path was right, then I still got the error:
Zsh: command not found: valet
And if I wrote: which valet
- then it (obviously) just responded with valet not found
.
Removal of Composer
What fixed it was to remove all my composer
-installations. Composer can be located in several different locations (and installed by brew). So in order to remove it, then do this (inspired by this post, but it lacks a couple of steps):
- Remove your
composer
- or -composer.phar
-file. You can find them by running which composer
and/or which composer.phar
.
- Remove your
.composer
-folder (usually located here: ~/.composer
).
- Then make sure that there isn't an installation done with Homebrew (this was what I think made the collision for me). You do it by running
brew unlink composer
followed by brew remove composer
.
- Then, - if you want to be 100% sure that it's all gone, then go to your root (
cd /
) and run this command: find ./* -name 'composer.phar'
and this find ./* -name 'composer'
. That should tell you of all the locations where the Composer-installation can be installed.
When all that's removed, then you should be rid of Composer (entirely).
... Then install it again, - and see if you can get valet
to work (it did for me).