我正在尝试更新我的依赖项并通过 Windows CMD 运行 php [source_to_project]\composer.phar
更新,但 Composer 正在从 php.exe 文件夹中读取 composer.json 文件。我的系统中没有安装 composer,我只能运行 composer.phar
文件。我还检查了我的 php.exe 的位置,在这个目录中,我可以看到我试图从我的项目中安装的供应商/[包](来自不同的目录,包含 composer.phar)
知道为什么会这样吗?
PS:上周我能够使用相同的过程安装/更新/要求,但现在我不能。
最佳答案
你的 COMPOSER 环境变量是什么?
也许你可以试试这个:
https://getcomposer.org/doc/03-cli.md#environment-variables
By setting the COMPOSER env variable it is possible to set the filename of composer.json to something else.
For example:
COMPOSER=composer-other.json php composer.phar install
The generated lock file will use the same name: composer-other.lock in this example.
关于php - composer.phar 没有使用当前目录的 composer.json 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47790445/