路径斜杠问题 - 作曲家在 win mintty 术语上运行



我有一个复杂的设置,其中我使用MSYS2(与cygwin相同),并且我从Windows系统加载了作曲家,当autoload _real.php去查看供应商文件夹时,它会弄乱路径。

这是路径,我相信错误的来源与路径是反斜杠,然后是正斜杠直接相关。

Fatal error: composerRequire13a8867c9869fbff9e601f6ade4acdee(): Failed opening required 'C:UsersxxxDocumentsprojectsproject1vendorcomposer/../laravel/framework/src/Illuminate/Support/helpers.php' (include_path='.;C:phppear') 

echo $PATH

~/.config/composer/vendor/bin:/home/me/bin:/c/Users/me/AppData/Roaming/npm:/cygdrive/c/Users/me/AppData/Roaming/Composer/vendor/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/Program Files (x86)/PHP/v5.6:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem:/c/WINDOWS/System32/WindowsPowerShell/v1.0:/c/Windows/CCM:/c/Windows/CCM:/c/Windows/CCM:/c/Program Files/Dell/Dell Data Protection/Drivers/TSS/bin:/c/Program Files/Dell/Dell Data Protection/Encryption:/c/Program Files/nodejs:/c/Users/me/AppData/Local/atom/bin:/c/Users/me/AppData/Roaming/npm:/c/Users/me/AppData/Local/Programs/Git/cmd:/c/Users/me/AppData/Local/Programs/Git/mingw64/bin:/c/Users/me/AppData/Local/Programs/Git/usr/bin:/c/Users/me/AppData/Local/ComposerSetup/bin:/c/Users/me/AppData/Roaming/Composer/vendor/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl
$ which composer
/home/me/bin/composer

问题:

  • 有谁知道我能做些什么来纠正斜杠?
  • 我路径上的重叠作曲家可能是问题所在,还是系统只是在看最后一个作曲家?

如果有人想看看autoload_real.php实际上在做什么,这里是方法。

function composerRequire4eee5c98214f71aca8f1a9103a64ab95($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
$GLOBALS['__composer_autoload_files'][$fileIdentifier] = true;
}
}

在意识到它只发生在一个包中后,我怀疑供应商目录中的某些内容本身已损坏。 我尝试删除整个供应商目录,然后再次运行composer install。 那次奏效了。

溶液

rm -r project/vendors
composer install

最新更新