将laravel从6.03更新到6.18时出错

问题描述

尝试将Laravel从6.03升级到6.18时出现此错误 无法删除D:\ xampp \ htdocs \ BaladyFreshFarm \ vendor / laravel / framework \ src \ Illuminate: 这可能是由于防病毒或Windows Search Indexer在分析文件时将其锁定

PS D:\xampp\htdocs\XXXXX> composer update
Loading composer repositories with package @R_825_4045@ion
Updating dependencies (including require-dev)
Package operations: 5 installs,35 updates,0 removals
  - Updating laravel/framework (v6.0.3 => v6.18.35):     Update Failed (Could not delete D:\xampp\htdocs\BaladyFreshFarm\vendor/laravel/framework\src\Illuminate:
This can be due to an antivirus or the Windows Search Indexer locking the file while they are analyzed)
    Would you like to try reinstalling the package instead [yes]?
  - Removing laravel/framework (v6.0.3)


  [RuntimeException]
  Could not delete D:\xampp\htdocs\BaladyFreshFarm\vendor/laravel/framework\src\Illuminate:
  This can be due to an antivirus or the Windows Search Indexer locking the file while they are analyzed


update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [--with-dependencies] [--with-all-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [-i|--interactive] [--root-reqs] [--] [<packages>]...

PS D:\xampp\htdocs\BaladyFreshFarm>

解决方法

您可以尝试删除D:\ xampp \ htdocs \ BaladyFreshFarm \ vendor / laravel / framework \ src \ Illuminate 手动。如果这样做不起作用,请尝试重新启动并关闭防病毒功能,然后重试。

,

像管理员一样运行您的IDE或终端,然后重试。

,

我发生了同样的事情,经过数小时的调试,我发现:

  • 确保您的vscode或powershell或cmd具有“管理”权限。
  • 确保您的Web服务器运行正常。

不执行的操作
在我的情况下,Proxy没什么问题,而仅仅是许可和有效的网络 服务器。但是我必须重新安装xampp才能正确解决此问题,因为我在调试时篡改了一些文件