Laravel安装帆问题((23)书写体失败) [英] Laravel installation sail problem ((23) Failed writing body)

查看:70
本文介绍了Laravel安装帆问题((23)书写体失败)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用原始的laravel文档安装laravel,但是什么也没有发生,我遇到了很多错误,例如,我尝试了

当然,当您解决该问题时,该过程就很有意义了,Sail确实提供了一些有用的捷径,可以使Docker快速启动并运行Laravel项目,但是可以认为完全的新手可以认为它可以处理所有事情,因此可以原谅.

旁注

在PowerShell中出现错误的原因是因为PS具有 curl 的别名,但没有您期望的卷曲.( Power Shell Windows 8.1中的cURL:名称为'localhost'的驱动器不存在" )

您可以永久删除此文件( https://github.com/lukesampson/scoop/issues/56#issuecomment-609098474 ),但现在您可能不需要知道如何在Linux shell中使用该命令.

I try to install laravel with the original laravel document but nothing happened, I got many errors, for example I tried this command on CMD;

curl -s https://laravel.build/example-app | bash

but I got this error

(23) Failed writing body

When I tried with PowerShell I got this error;

cmdlet Invoke-WebRequest at command pipeline position 1
Supply values for the following parameters:
Uri:
curl : Cannot find drive. A drive with the name 'https' does not exist.
At line:1 char:1
 curl -s https://laravel.build/example-app | bash
   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 CategoryInfo          : ObjectNotFound: (https:String) [Invoke-WebRequest], DriveNotFoundException
 FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Specs;

Docker Engine v20.10.0

Edition Windows 10 Home Version 20H2 Installed on ‎14/‎08/‎2020 OS build 19042.685 Experience Windows Feature Experience Pack 120.2212.551.0

解决方案

I ran into this issue as well and found the (usually excellent) Laravel documentation to be a little vague.

First of all, I have some knowledge of Docker but wanted to get much better acquainted so the recent release of Laravel Sail seemed like an excellent starting point.

  1. Install Docker Desktop https://docs.docker.com/docker-for-windows/install/
  2. Install and enable WSL2 https://docs.microsoft.com/en-us/windows/wsl/install-win10#simplified-installation-for-windows-insiders
  3. The Laravel docs mention this in above step but the part I missed was installing a Linux distribution at the same time (via the Microsoft Store). I assumed Sail took care of this part.
  4. Goto the windows store a get your distro e.g. Ubuntu 20.04 (https://www.microsoft.com/en-gb/p/ubuntu-2004-lts/9n6svws3rx71?rtc=1)
  5. Install Windows Terminal - https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?rtc=1&activetab=pivot:overviewtab. Up until now, I was using Cmder or ConEmu rather than the Command Prompt. The important difference is you can start a new shell for windows or any of the Linux distributions you have installed. Again, I assumed you could use the curl -s https://laravel.build/example-app | bash command in my windows Cmder - not the case.
  6. Start up a new Linux shell and if you ls you'll see your Windows filesystem. From there I cd'd to my projects directory, ran curl -s https://laravel.build/example-app | bash and that took care of the rest.

One caveat is that you may have to enable any downloaded Linux distributions in Docker:

Of course, the process makes sense when you solve it and Sail does offer some useful shortcuts in getting a Laravel project up and running quickly with Docker but complete newcomers could be forgiven for thinking it takes care of absolutely everything - which it doesn't.

Side note

The reason you were getting the error in PowerShell is because PS has an alias for curl but not the curl you expect. (cURL in power shell windows 8.1: "A drive with the name 'localhost' does not exist")

You can permanently remove this (https://github.com/lukesampson/scoop/issues/56#issuecomment-609098474) but you may not need to now you know how to use the command in your Linux shell.

这篇关于Laravel安装帆问题((23)书写体失败)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆