doqo89924 2018-03-29 06:57
浏览 150

Windows - PHP - 'bin \ behat'不被识别为内部或外部命令,可操作程序或批处理文件

So I'm trying to run a test on my framework on Windows 10 after a git clone but I keep getting these issues.
Here's what I tried and the results:

1."bin/behat" in terminal - 'bin' is not recognized as an internal or external command,operable program or batch file.
2. "bin\behat" in terminal - 'bin\behat' is not recognized as an internal or external command,operable program or batch file.
3. "php bin/behat" or "php bin\behat" in terminal -

**dir=$(d=${0%[/\\]*}; cd "$d"; cd "../vendor/behat/behat/bin" && pwd)
# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
# Cygwin paths start with /cygdrive/ which will break windows PHP,
# so we need to translate the dir path to windows format. However
# we could be using cygwin PHP which does not require this, so we
# test if the path to PHP starts with /cygdrive/ rather than /usr/bin
if [[ $(which php) == /cygdrive/* ]]; then
dir=$(cygpath -m $dir);
fi
fi
dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/behat" "$@"**
  • 写回答

1条回答 默认 最新

  • dtxooq1020 2018-03-29 09:35
    关注
    1. Make sure Behat is installed - you have a vendor directory
    2. If not installed run install command
    3. Make sure you are running from the right directory - the one that contains composer.json
    4. Make sure you are using the right separator based on the command line you are using - look in the command line and see what type it is used / or \
    评论

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP