Laravel installation sail problem ((23) Failed writing body)
Stefan Bogdanescu
Founder & Senior Architect · 2026-06-29
Solving the Laravel Installation Headache on Windows: Why curl | bash Fails
As a senior developer, I’ve seen countless developers run into installation hiccups, especially when moving between operating systems or shells. The issue you are encountering—the errors like (23) Failed writing body or PowerShell reporting that it cannot find the necessary drive (https)—is not a problem with the Laravel installation script itself, but rather a conflict between the standard Linux/macOS command piping structure and how Windows Command Prompt (CMD) or PowerShell interprets those commands.
This post will diagnose why this happens and provide you with robust, reliable methods for setting up your Laravel development environment on Windows.
Understanding the Shell Conflict
The command you are attempting to use:
curl -s https://laravel.build/example-app | bash
is a highly effective, standard method used in Unix-like operating systems (Linux and macOS) to download content from a URL (curl) and pipe that output directly into another command interpreter (| bash). This piping mechanism is native to Bash shells.
When you run this in Windows environments like CMD or PowerShell, the shell attempts to execute each part of the pipeline individually. In your case:
- PowerShell: It tries to interpret
curl(or its equivalent) and then tries to pipe the output intobash, which does not exist natively on Windows, leading to errors about missing drives or command execution failures. - CMD: The shell struggles with the redirection (
|) when dealing with external binary commands in this specific context, resulting in file writing errors like(23) Failed writing body.
The core takeaway is that cross-platform installation scripts designed for Unix environments often break when ported directly to Windows command lines without an intermediary layer.
The Recommended Solutions for Laravel on Windows
Since the direct piping method is unreliable on native Windows shells, we must pivot to methods that leverage tools natively supported by Windows or use virtualization layers. For modern Laravel development, relying on established package managers and containerization is far superior.
Solution 1: Use PowerShell with Native Tools (The Intermediate Step)
If you insist on using a command-line approach, try replacing the complex pipe with native Windows commands. While there isn't a direct equivalent for that specific builder script, you can often achieve similar results by downloading files directly and running setup scripts sequentially.
For simple file downloads in PowerShell, use Invoke-WebRequest:
# Download the example application directly using PowerShell commands
Invoke-WebRequest -Uri "https://laravel.build/example-app" -OutFile example-app.zip
# You would then need to manually unzip and follow the setup instructions.
While this is more cumbersome, it forces the operation within a shell environment that understands Windows file system operations, making debugging much easier than dealing with cryptic pipe errors.
Solution 2: The Professional Approach – Dockerization (The Laravel Way)
For any serious Laravel project, especially when managing dependencies and server environments, the gold standard is containerization using Docker. This completely bypasses operating system-specific installation headaches. Containerizing your application ensures that the environment is identical regardless of whether you are on Windows, macOS, or Linux.
Laravel projects are highly compatible with Docker setups. You can use a simple Dockerfile to define exactly how your PHP and Laravel environment should run. This approach aligns perfectly with best practices outlined by organizations like the Laravel Company.
Steps for Docker Setup (Conceptual):
- Install Docker Desktop on your Windows machine.
- Create a
Dockerfilethat sets up a PHP/Laravel image. - Use Docker to build and run your application container.
This method removes the reliance on complex shell piping entirely, shifting the focus from fragile command execution to robust environment management.
Conclusion
The installation errors you faced were symptoms of an operating system incompatibility rather than a flaw in the Laravel package. As developers working across platforms, understanding the context of your shell is crucial. For future projects, I strongly recommend adopting containerization (Docker) for local development environments on Windows. It provides consistency, eliminates environment-specific bugs, and aligns with the professional standards expected when building scalable applications. Move away from direct curl | bash piping and embrace tools designed for cross-platform dependency management.