【发布时间】:2018-10-18 21:58:54
【问题描述】:
每次我将 Laravel 项目(例如:https://github.com/flytomek/shopping-list)克隆到我的 XAMPP localhost 中时,都会收到这个奇怪的错误:
警告:需要(/Applications/XAMPP/xamppfiles/htdocs/shopping-list/vendor/autoload.php):无法打开流:/Applications/XAMPP/xamppfiles/htdocs/shopping-list 中没有这样的文件或目录/工匠在第 18 行
致命错误:require():需要打开失败 '/Applications/XAMPP/xamppfiles/htdocs/shopping-list/vendor/autoload.php' (include_path='.:') 在 /Applications/XAMPP/xamppfiles/htdocs/shopping-list/artisan 在第 18 行
我查看了许多类似的帖子,运行: composer install --no-scripts 我仍然得到同样的错误。
首先我认为这是因为文件权限,我正在运行 macOS,并且遇到了脚本无法访问文件的类似问题,但我运行了 chmod -R 777 shopping-list 并得到了同样的问题。
【问题讨论】:
-
表示
vendors目录中的文件不存在。检查它是否正确。我认为您在使用 composer 安装依赖项时做错了。你为什么用--no-scripts? -
试试
composer update和composer dump-autoload