简体   繁体   English

出现错误:Windows 平台不支持 TTY 模式

[英]Getting Error: TTY mode is not supported on Windows platform

I am trying to improve my testing workflow by running my phpunit tests automatically when I make a change.我试图通过在进行更改时自动运行 phpunit 测试来改进我的测试工作流程。

I have a local dev server on my windows machine and I am trying to run phpunit-watch .我的 windows 机器上有一个本地开发服务器,我正在尝试运行phpunit-watch

TTY mode is not supported on windows platform.

I keep getting this error, is there any work around?我一直收到这个错误,有什么解决方法吗?

The plugin: https://github.com/spatie/phpunit-watcher插件: https://github.com/spatie/phpunit-watcher

没有解决方法,Windows平台不支持TTY模式,这是有原因的。

You could try using WSL ( Windows Subsystem for Linux ).您可以尝试使用 WSL(适用于 Linux 的 Windows 子系统)。 https://docs.microsoft.com/en-us/windows/wsl/install-win10 https://docs.microsoft.com/en-us/windows/wsl/install-win10

If you do this route, note that the file systems between Linux and Windows are different.如果你走这条路线,注意Linux和Windows之间的文件系统是不同的。 The WSL will mount your drives which slows down performance, so if you run your command in /mnt/c/my-folder , it will run slower than you expect. WSL 将挂载您的驱动器,这会降低性能,因此如果您在/mnt/c/my-folder运行您的命令,它的运行速度将比您预期的要慢。

The only solutions I know for this so far are: Deal with it, or move your files into the Linux layer.到目前为止,我知道的唯一解决方案是:处理它,或者将您的文件移动到 Linux 层。 If you move your files to the Linux system, you'll get expected speeds.如果您将文件移动到 Linux 系统,您将获得预期的速度。

All php artisan db does is call the MySQL command line, which you can do yourself.所有 php artisan db 所做的都是调用 MySQL 命令行,您可以自己完成。 Check your.env file to get values for the host, username, and password.检查 your.env 文件以获取主机、用户名和密码的值。 Then fill them into this command:然后将它们填充到此命令中:

mysql -h host -u username -ppassword mysql -h 主机 -u 用户名 -ppassword

The artisan test command (and maybe other commands as well) has an option --without-tty that allows you to run the command from the Windows command line. artisan test命令(可能还有其他命令)有一个选项--without-tty允许您从 Windows 命令行运行该命令。 Like so:像这样:

php artisan test --without-tty

Perhaps, this option has been only present in recent versions of Laravel.也许,这个选项只出现在 Laravel 的最新版本中。

I am not familiar with phpunit-watch yet, but if there is a way to configure the commands used within it, then including this option should solve the issue.我还不熟悉 phpunit-watch,但如果有办法配置其中使用的命令,那么包含此选项应该可以解决问题。

Note: AFAIK, phpunit, itself, runs just fine from the Windows command line.注意:据我所知,phpunit 本身可以从 Windows 命令行正常运行。 Indeed, I use it all the time.确实,我一直都在使用它。 Like so:像这样:

vendor\bin\phpunit

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Laravel:Windows 平台不支持 TTY 模式 - Laravel: TTY mode is not supported on Windows platform Laravel Dusk(Windows平台不支持TTY模式) - Laravel Dusk (TTY mode is not supported on Windows platform) 自动创建 Laravel 项目失败并出现错误:TTY 模式需要 /dev/tty 是可读/可写的 - Automatically creating Laravel project fails with error: TTY mode requires /dev/tty to be read/writable 出现错误'此路由不支持 GET 方法。 支持的方法:HEAD' - Getting Error 'The GET method is not supported for this route. Supported methods: HEAD' 获取错误支持的方法:GET、HEAD Laravel - Getting error Supported methods: GET, HEAD Laravel 更新 function 不断收到此错误:此路由不支持 PATCH 方法。 支持的方法:GET、HEAD - Update function keep getting this error: The PATCH method is not supported for this route. Supported methods: GET, HEAD 在 Google Cloud Platform 上托管的 Laravel MySQL 应用程序上出现 500 错误 - Getting 500 error on Laravel MySQL application hosted on Google Cloud Platform 上传 Laravel 6.0 项目后,我收到“此路由不支持 GET 方法。支持的方法:POST。” 错误 - After uploading Laravel 6.0 project I am getting "The GET method is not supported for this route. Supported methods: POST." error 为什么我不断收到“此路由不支持 GET 方法。支持的方法:POST。” laravel 9 api 出错? - Why do i keep getting "The GET method is not supported for this route. Supported methods: POST." error on laravel 9 api? 我收到删除记录的错误,详细问题如下。 “此路由不支持 GET 方法。支持的方法:POST。” - i am getting this error for deleting a record, detail issue is below. " The GET method is not supported for this route. Supported methods: POST. "
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM