Laravel 5/Composer终端错误:sh.exe": Composer: command not f


Laravel 5/Composer terminal error: sh.exe": composer: command not found

当我试图在我的终端(Git Bash)在我当前的项目文件路径下运行composer require "illuminate/html":"5.0.*"时,我得到了标题中的错误。即使我输入像composer -v这样的东西,我也会得到同样的错误。

我甚至试过重新安装composer,它安装得很好,但命令仍然不起作用。

在PhpSTORM终端中,运行相同的命令会出现这个错误:'composer' is not recognized as an internal or external command, operable program or bath file.

我有VirtualBox, Vagrant和Laravel都正确安装了Composer(我知道这一切都很好,因为我的代码是伟大的,工作得很好,当尝试它的生活和什么不是)…除非我在这里遗漏了什么(Laravel noob)。

为什么会发生这种情况?

如果您在虚拟机之外(在您的主机系统中)安装了composer,并且您希望在不ssh到您的流浪机的情况下使用它:

确保将作曲家目录添加到PATH中。然后关闭当前终端并重新加载一个新终端。必须关闭终端才能重新加载PATH。

错误sh.exe": composer: command not found表示在当前文件夹或PATH中没有找到编写器。

发现为什么我得到错误:忘记ssh。

修复是这样的:vagrant ssh在终端