Giter Site home page Giter Site logo

Comments (14)

jessarcher avatar jessarcher commented on August 16, 2024 1

Thanks both!

I'm struggling to figure out what's going on here. The code that triggers that error should only execute if stream_isatty(STDIN) is false.

I'm just setting up a Windows machine to try to replicate this.

from installer.

mstfkhazaal avatar mstfkhazaal commented on August 16, 2024 1

I have same error in Mac
i use sail https://laravel.com/docs/10.x/installation#sail-on-macos

from installer.

jessarcher avatar jessarcher commented on August 16, 2024

Hey @sixtusagbo,

What operating system are you running the laravel new command on?

from installer.

sixtusagbo avatar sixtusagbo commented on August 16, 2024

Windows 10 Version 22H2 (OS Build 19045.3448)

from installer.

jessarcher avatar jessarcher commented on August 16, 2024

Thanks @sixtusagbo,

Are you able to give me the results of this command:

php -r "var_dump(stream_isatty(STDIN));"

(I'm not sure if it should be php.exe instead of just php)

from installer.

sixtusagbo avatar sixtusagbo commented on August 16, 2024

Just php is okay, anyone can work. I use mingw on bash.
The result of that command is bool(true)

from installer.

iyefreedy avatar iyefreedy commented on August 16, 2024

I've had the same issue as @sixtusagbo mentioned.
Is it solved ?

from installer.

jessarcher avatar jessarcher commented on August 16, 2024

Hi @iyefreedy,

Not yet. Could you please tell me your operating system and the result of running the command from #286 (comment).

from installer.

iyefreedy avatar iyefreedy commented on August 16, 2024

image
This is the result of the command.
And I am using Windows 10 Education 64-bit operating system (10.0, Build 190454)

from installer.

jessarcher avatar jessarcher commented on August 16, 2024

@iyefreedy are you also using mingw on bash? Or something different?

from installer.

jessarcher avatar jessarcher commented on August 16, 2024

I've replicated the issue.

Very strange behaviour. The stream_isatty function returns differently depending on whether you execute the script directly, or pass it as an argument to php.

Take the following test.php file for example:

#!/usr/bin/env PHP
<?php

var_dump(stream_isatty(STDIN));

And note the different result depending on how you execute it:

$ php test.php
bool(true)

$ ./test.php
bool(false)

While I look into this, you can run the installer with the -n flag to make it non-interactive. E.g.:

laravel new example-app -n

from installer.

jessarcher avatar jessarcher commented on August 16, 2024

This is caused by mintty and its use of a pipe instead of a TTY.

php is aliased to wintty php.exe, which is why that works. php.exe is not aliased, nor are scripts with a shebang, so those don't work.

I can't find a reliable way to detect whether STDIN is interactive when using mintty so I need to re-think the approach for non-interactive mode in https://github.com/laravel/prompts.

The easiest solution for the time being is probably just to make the fallback mode take priority over the non-interactive mode. An alternative would be to force interactive mode when mintty is used without wintty, but this would still cause issues when mintty is not actually interactive.

from installer.

driesvints avatar driesvints commented on August 16, 2024

Try again all?

from installer.

jessarcher avatar jessarcher commented on August 16, 2024

LGTM (after composer global update)

image

from installer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.