dou91855
2017-10-18 01:31
浏览 130
已采纳

laravel 5.5:php artisan tinker:ErrorException:目录不为空[重复]

This question is an exact duplicate of:

I am using windows. ... In my CMD, was using tinker, myql, serve, etc... and they all went well...

Suddenly, when i exit tinker and enter tinker again... this error comes up

[ErrorException] rmdir(C:\Usersobert\AppData\Local\Temp\php-xdg-runtime-dir-fallback-): Directory not empty

Then sure enough, I tried removing, can't I tried renaming the folder to something else, it worked... "php artisan tinker" works... but I can't run usual command $user = App\User::all(); Then I exit... then enter tinker again... again the [ErrorException] rmdir(C:\Usersobert\AppData\Local\Temp\php-xdg-runtime-dir-fallback-): Directory not empty

Firstly, I searched similar problems but the solution doesn't work for me permanently (PHP Artisan Tinker not working with Laravel 5.5.16)

Secondly, I tried making laravel new NewProject , run tinker... still same ErrorException

Thirdly, I tried composer update or composer require laravel/tinker ... then add the Laravel\Tinker\TinkerServiceProvider::class, inside config/app.php => providers.... still same ErrorException

Btw , this is the full length error

``` php artisan tinker -vvv --ansi ? [37;41m ?[39;49m ?[37;41m [ErrorException] ?[39;49m ?[37;41m rmdir(C:\Usersobert\AppData\Local\Temp\php-xdg-runtime-dir-fallback-): Directory not empty ?[39;49m ?[37;41m ?[39;49m

?[33mException trace:?[39m
 () at ?[32mC:\xampp\htdocs\blog\vendor\dnoegel\php-xdg-base-dir\src\Xdg.php:110?[39m
 Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() at ?[32mn/a:n/a?[39m
 rmdir() at ?[32mC:\xampp\htdocs\blog\vendor\dnoegel\php-xdg-base-dir\src\Xdg.php:110?[39m
 XdgBaseDir\Xdg->getRuntimeDir() at ?[32mC:\xampp\htdocs\blog\vendor\psy\psysh\src\Psy\ConfigPaths.php:139?[39m
 Psy\ConfigPaths::getRuntimeDir() at ?[32mC:\xampp\htdocs\blog\vendor\psy\psysh\src\Psy\Configuration.php:348?[39m
 Psy\Configuration->getRuntimeDir() at ?[32mC:\xampp\htdocs\blog\vendor\psy\psysh\src\Psy\Shell.php:173?[39m
 Psy\Shell->getDefaultCommands() at ?[32mC:\xampp\htdocs\blog\vendor\symfony\console\Application.php:1163?[39m
 Symfony\Component\Console\Application->init() at ?[32mC:\xampp\htdocs\blog\vendor\symfony\console\Application.php:431?[39m
 Symfony\Component\Console\Application->add() at ?[32mC:\xampp\htdocs\blog\vendor\psy\psysh\src\Psy\Shell.php:134?[39m
 Psy\Shell->add() at ?[32mC:\xampp\htdocs\blog\vendor\symfony\console\Application.php:415?[39m
 Symfony\Component\Console\Application->addCommands() at ?[32mC:\xampp\htdocs\blog\vendor\laravel\tinker\src\Console\TinkerCommand.php
:54?[39m
 Laravel\Tinker\Console\TinkerCommand->handle() at ?[32mn/a:n/a?[39m
 call_user_func_array() at ?[32mC:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:29?[39m
 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at ?[32mC:\xampp\htdocs\blog\vendor\laravel\framework\src\Illumina
te\Container\BoundMethod.php:87?[39m
 Illuminate\Container\BoundMethod::callBoundMethod() at ?[32mC:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Container\Bo
undMethod.php:31?[39m
 Illuminate\Container\BoundMethod::call() at ?[32mC:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Container\Container.php
:549?[39m
 Illuminate\Container\Container->call() at ?[32mC:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Console\Command.php:180?[
39m
 Illuminate\Console\Command->execute() at ?[32mC:\xampp\htdocs\blog\vendor\symfony\console\Command\Command.php:262?[39m
 Symfony\Component\Console\Command\Command->run() at ?[32mC:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Console\Command
.php:167?[39m
 Illuminate\Console\Command->run() at ?[32mC:\xampp\htdocs\blog\vendor\symfony\console\Application.php:888?[39m
 Symfony\Component\Console\Application->doRunCommand() at ?[32mC:\xampp\htdocs\blog\vendor\symfony\console\Application.php:224?[39m
 Symfony\Component\Console\Application->doRun() at ?[32mC:\xampp\htdocs\blog\vendor\symfony\console\Application.php:125?[39m
 Symfony\Component\Console\Application->run() at ?[32mC:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Console\Application
.php:88?[39m
 Illuminate\Console\Application->run() at ?[32mC:\xampp\htdocs\blog\vendor\laravel\framework\src\Illuminate\Foundation\Console\Kernel.
php:121?[39m
 Illuminate\Foundation\Console\Kernel->handle() at ?[32mC:\xampp\htdocs\blog\artisan:37?[39m

```

Can anybody please help? Thanks

</div>
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • dsfds2353 2017-10-18 16:56
    已采纳

    EDIT: The below is no longer necessary. Version 0.8.13 is already out and fixes the issue.


    Same issue in Laravel 5.5. I just downgraded to the previous version of Psy Shell until it gets fixed by going into the project directory and entering

    composer require psy/psysh:0.8.11
    

    at the command line to downgrade to the previous version of Psy Shell. They'll fix it eventually and then I'll update again to the new version.

    点赞 评论
  • dsnm64969 2017-10-18 09:21

    I think I just found out the solution... it may not be the best one... or temporary solution, i guess

    I basically manually delete the psysh folder every time before tinker

    rmdir c:\Usersobert\AppData\Local\Temp\php-xdg-runtime-dir-fallback-\psysh then tinker

    Oh btw, above I mentioned I already tried removing but failed, but when I tried removing psysh instead of "php-xdg-runtime-dir-fallback-" , then it worked... Also it turns out the tinker commands etc works ok too... Again u still have to remove manually though.

    Anybody with better solution, please add below, I am really eager to know why or how come it happened? And most importantly more permanent solution.

    I already posted this question or searched similar issues in laracasts, but no answers yet.

    Cheers

    点赞 评论
  • dongli7236 2017-10-18 16:02

    This is a bug with an underlying library on Windows. See bobthecow/psysh#430 for more info and a temporary fix until a workaround is released.

    点赞 评论

相关推荐 更多相似问题