skip to Main Content

i am using laravel on docker . i run my project when i exec into container and use

php artisan tinker

no matter what command i run i receive this error :

bash-5.1$ php artisan tinker
Psy Shell v0.11.8 (PHP 8.0.14 — cli) by Justin Hileman
>>> AppModelsUser::where('id',12)->first()->createToken('testToken');
/usr/bin/less: unrecognized option: X                       
BusyBox v1.34.1 (2021-11-23 00:57:35 UTC) multi-call binary.
                                                            
Usage: less [-EFIMmNSRh~] [FILE]...                         
                                                            
View FILE (or stdin) one screenful at a time                
                                                            
        -E      Quit once the end of a file is reached      
        -F      Quit if entire file fits on first screen    
        -I      Ignore case in all searches                 
        -M,-m   Display status line with line numbers       
                and percentage through the file             
        -N      Prefix line number to each line
        -S      Truncate long lines
        -R      Remove color escape codes in input
        -~      Suppress ~s displayed past EOF
RuntimeException with message 'Error closing output stream'

any idea what can be wrong here ?

2

Answers


  1. Busybox contains cutdown versions of many Unix/Linux utilities, including less. Either remove it and install the less package, as well as the other utilities it mimics, or hack artisan and remove the -X switch against /usr/bin/less. All the -X switch does is sort alphabetically by entry extension

    Login or Signup to reply.
  2. Ugh just spent a ton of time messing with this one myself.

    The root cause of this issue is the upgrading of the psypsh shell package that tinker users.

    You can see in the release notes here https://github.com/bobthecow/psysh/releases/tag/v0.11.3

    There are a few ways around this, as mentioned above, you can just install the less package using apk or apt-get.

    You can also set the cli.pager property in your php.ini file to explicitly call less without the -X switch.

    More info here: https://github.com/bobthecow/psysh/issues/717

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search