When I run behat -v
(or any other Behat command) in Git bash I get the following error
bash: behat: command not found
It works fine in the Windows command prompt.
I've tried installing Git with different options such as 'Use Git from Git Bash only', 'Use Git from the Windows Command Prompt', 'Use MinTTY', 'Use Windows default console window', but nothing has worked.
I installed Behat version 3.2.2 local to a project using Composer.
Does anybody know how to fix this?
You need to run Behat from the location where is installed.
Navigate to the folder the Behat is installed (this should contain bin, vendor, composer.json etc) then open a command line there (any will do bash or cmd) and run Behat from there.
Use command for bash:
Or for cmd:
One last thing to check. Find your git shortcut, right click and check Properties->Shortcut tab and in the target you should have something like this:
Close and reopen git console and it should work.
To find the shortcut search git from start and then right click on Git Bash and click open file location.