问题描述:
历史项目,vendor也提交到了版本控制,由于一些原因,目录中.git丢失,导致composer update失败
报错:
In ClassMapGenerator.php line 129: Could not scan for classes inside "vendor/katzgrau/klogger/src/" which does not appear to be a file nor a folder install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [--audit] [- -audit-format AUDIT-FORMAT] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ign ore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>...]
解决办法:
删除掉Lock文件后,执行update,会提示确实.git文件,是否重新下载,选yes即可。或者也可以手动删除掉对应的目录,重新下载。
PS D:www> composer update Loading composer repositories with package information Updating dependencies Lock file operations: 0 installs, 1 update, 0 removals - Downgrading katzgrau/klogger (dev-master de2d3ab => 1.2.1) Writing lock file Installing dependencies from lock file (including require-dev) Package operations: 0 installs, 1 update, 0 removals - Syncing katzgrau/klogger (1.2.1) into cache - Downgrading katzgrau/klogger (dev-master de2d3ab => 1.2.1): Update failed (The .git directory is missing from vendorkatzgrauklogger, see https://getc omposer.org/commit-deps for more information) Would you like to try reinstalling the package instead [yes]? yes - Removing katzgrau/klogger (dev-master de2d3ab) - Installing katzgrau/klogger (1.2.1): Cloning a4ed373fa8 from cache Generating autoload files 7 packages you are using are looking for funding. Use the `composer fund` command to find out more! Found 1 security vulnerability advisory affecting 1 package. Run composer audit for a full list of advisories.
------------正 文 已 结 束, 感 谢 您 的 阅 读 (折雨的天空)--------------------
转载请注明本文标题和链接:《Composer遇到问题:Could not scan for classes inside "vendor/katzgrau/klogger/src/" which does not appear to be a file nor a folder》
发表评论