laravel - 安装 Behat 时出现“-bash: behat: command not found”
问题描述
我已经安装了 Laravel 5.6 的干净版本。然后我已经成功安装了 Behat,输出如下。
composer require behat/behat behat/mink behat/mink-extension laracasts/behat-laravel-extension --dev
Using version ^3.4 for behat/behat
Using version ^1.7 for behat/mink
Using version ^2.3 for behat/mink-extension
Using version ^1.1 for laracasts/behat-laravel-extension
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 15 installs, 0 updates, 0 removals
- Installing symfony/dom-crawler (v4.1.2): Downloading (100%)
- Installing behat/mink (dev-master d5ee350): Cloning d5ee350c40
- Installing symfony/browser-kit (v4.1.2): Downloading (100%)
- Installing behat/mink-browserkit-driver (1.3.3): Downloading (100%)
- Installing symfony/yaml (v4.1.2): Downloading (100%)
- Installing symfony/dependency-injection (v4.1.2): Downloading (100%)
- Installing symfony/filesystem (v4.1.2): Downloading (100%)
- Installing symfony/config (v4.1.2): Downloading (100%)
- Installing symfony/class-loader (v3.4.13): Downloading (100%)
- Installing container-interop/container-interop (1.2.0): Downloading (100%)
- Installing behat/transliterator (v1.2.0): Downloading (100%)
- Installing behat/gherkin (v4.5.1): Downloading (100%)
- Installing behat/behat (v3.4.3): Downloading (100%)
- Installing laracasts/behat-laravel-extension (1.1.1): Downloading (100%)
- Installing behat/mink-extension (2.3.1): Downloading (100%)
behat/mink suggests installing behat/mink-goutte-driver (fast headless driver for any app without JS emulation)
behat/mink suggests installing behat/mink-selenium2-driver (slow, but JS-enabled driver for any app (requires Selenium2))
behat/mink suggests installing behat/mink-zombie-driver (fast and JS-enabled headless driver for any app (requires node.js))
behat/mink suggests installing dmore/chrome-mink-driver (fast and JS-enabled driver for any app (requires chromium or google chrome))
symfony/dependency-injection suggests installing symfony/expression-language (For using expressions in service container configuration)
symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
symfony/class-loader suggests installing symfony/polyfill-apcu (For using ApcClassLoader on HHVM)
behat/behat suggests installing behat/symfony2-extension (for integration with Symfony2 web framework)
behat/behat suggests installing behat/yii-extension (for integration with Yii web framework)
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nunomaduro/collision
Package manifest generated successfully
但是当我尝试用
behat --init
我收到以下错误:
-bash: behat: command not found
我究竟做错了什么?在此之前我已经运行了 composer self-update 。
解决方案
您没有全局安装 behat 全局安装或使用
vendor/bin/behat --init
如果要全局安装,请运行
composer global require behat/behat
希望这可以帮助。
推荐阅读
- c++ - 如何在 C++ 中获取、存储和打印非英语字符串
- jsp - 如何在之间获取文本
- sql-server - 如何区分每周和每月的日期之间的差异?
- java - 改进 Java 代码以在 Android 上更快地执行
- django - 如何从多个嵌套序列化程序中获取数据?
- python - BigQuery GA 分析的所有列数据
- css - 如何将双击锁定到 WooCommerce 中的变体
- operating-system - QEMU UEFI 应用程序始终为 SetTimer 返回无效参数
- reactjs - 从不包含唯一 ID 或字段的数组创建带有映射函数的列表时,在 React 中定义“KEY”的最佳方法是什么?
- python - 如何使用 selenium python 选择下一个下拉菜单