You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows 10环境下Laravel 5执行artisan命令报require错误求助

Fixing the "vendor/autoload.php not found" Error in Laravel 5 (Windows 10)

Hey there, that error means Laravel can’t locate the autoloader file Composer generates to load all your project’s dependencies. Let’s walk through how to fix this step by step:

Step 1: Confirm you’re in the correct project directory

First, double-check your command prompt (CMD or PowerShell) is pointed directly at your Laravel project root. The exact path you need is:
C:\Users\Djebi\OneDrive\Desktop\Nom-de-projet

To navigate there, run this command (the quotes are critical because your path includes spaces):

cd "C:\Users\Djebi\OneDrive\Desktop\Nom-de-projet"

Step 2: Install project dependencies with Composer

The vendor directory (and the missing autoload.php file inside it) is created automatically when you run Composer’s install command. If you haven’t done this yet (or the directory was accidentally deleted), run:

composer install

Wait for the process to finish—it will download all required packages for your Laravel 5 project and generate the missing autoloader file.

Step 3: Troubleshoot common Composer hiccups

If composer install fails, try these quick fixes:

  • Clear Composer’s cache: Cached files can cause unexpected issues. Run composer clear-cache then re-execute composer install.
  • Run as Administrator: Windows file permissions might block Composer from creating the vendor directory. Right-click your command prompt/PowerShell and select "Run as administrator" before running commands.
  • Pause OneDrive sync: Your project is stored in OneDrive, which might lock files during sync. Pause OneDrive temporarily while Composer runs to avoid conflicts.

Step 4: Verify the fix

Once Composer finishes, check if the vendor directory exists in your project root. Then test your artisan command again:

php artisan serve

That should resolve the "failed to open stream" error!

内容的提问来源于stack exchange,提问作者Hamza Djebiri

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 11:06:21