【问题标题】:Installing Laravel on Windows 11 via Curl issue: ambiguous redirect通过 Curl 问题在 Windows 11 上安装 Laravel:模糊重定向
【发布时间】:2022-10-20 16:00:53
【问题描述】:

我正在尝试通过 Curl 安装 Laravel,以便像这样将 Laravel Sail 与 docker 一起使用

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

但我得到这个错误

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
100   947    0   947    0     0    947      0 --:--:-- --:--:-- --:--:--  1835
: ambiguous redirect
-bash: line 2: $'\r': command not found
-bash: line 35: syntax error: unexpected end of file

为什么我会得到这个以及如何解决它?

【问题讨论】:

  • 您是否在 WSL 终端上运行该命令?参考:laravel.com/docs/8.x#getting-started-on-windows
  • windows powershell终端
  • 我使用了默认的 CMD 并开始下载,但是当它要求输入密码时,它什么也没做,当我按 CTRL+C 时,我发现它正在尝试将密码作为命令执行
  • 查看您尝试执行的脚本,您似乎应该从 WSL 而不是 Windows 运行它:laravel.build/example-app

标签: bash docker curl laravel-sail


【解决方案1】:

正如您在documentation 中所读到的,您必须在 Windows 终端中使用该命令行为您的 WSL2 Linux 操作系统开始一个新的终端会话。

here 你可以找到如何将 Ubuntu 设置为 Windows 终端的默认配置文件。

这对我有很大帮助。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2022-12-17
    • 2014-12-14
    • 2015-04-07
    • 2021-12-28
    • 1970-01-01
    • 1970-01-01
    • 2016-11-28
    • 2022-01-25
    相关资源
    最近更新 更多