Some folks struggle when they find out that the default $PATH from their Terminal.app environment is NOT replicated in Keyboard Maestro.
There's a simple way to work around this, and that is to add a variable named ENV_PATH to Keyboard Maestro and give it the same path you can find in your Terminal by using the command echo $PATH.
I have automated this process in the appended macro.
-Chris
NOTE:
If using macOS Ventura or later you'll need to change “Preferences” to “Settings” in the Select or Show a Menu Item action in the macro.