仅半满时出现编辑器已满磁盘错误



这是我第一次使用作曲家。我正在尝试构建一个使用它的项目,但我无法让作曲家正常运行。 对于命令编辑器诊断,我每次都会得到以下内容:

PS C:WinNMPWWWOro> composer diagnose
Checking composer.json: WARNING
Defining autoload.psr-4 with an empty namespace prefix is a bad idea for performance
License "Commercial" is not a valid SPDX license identifier, see https://spdx.org/licenses/ if you use an open license.
If the software is closed-source, you may use "proprietary" as license.
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com oauth access: OK
Checking disk free space: FAIL
The disk hosting C:/Users/Mark/AppData/Roaming/Composer is full

所有其他测试返回正常。我的磁盘有 64GB 可用空间。 我尝试搜索此问题,但几乎没有帮助。我将 php 中的内存限制提高到 512mb 作为黑暗中的镜头,但没有效果。与此相关的一些帖子表明它内存不足,但我的 ram 使用率永远不会超过 35%。

我尝试运行作曲家清除缓存没有任何效果。

尝试在 php 7.2.6,作曲家 1.6.5 上运行它

触发此错误消息的函数如下:

private function checkDiskSpace($config)
{
$minSpaceFree = 1024 * 1024;
if ((($df = @disk_free_space($dir = $config->get('home'))) !== false && $df < $minSpaceFree)
|| (($df = @disk_free_space($dir = $config->get('vendor-dir'))) !== false && $df < $minSpaceFree)
) {
return '<error>The disk hosting '.$dir.' is full</error>';
}
return true;
}

您可能希望编写一个小脚本来进行相同的检查,只是没有错误抑制。若要获取homevendor-dir的值,可以运行以下命令:

composer config home
composer config vendor-dir

一个粗略的想法:

$home = trim(`composer config home`);
$vendorDir = trim(`composer config vendor-dir`);
var_dump($home, disk_free_space($home));
var_dump($vendorDir, disk_free_space($vendorDir));

不要忘记确保您已启用完整的错误报告。

最新更新