将jq可执行文件添加到env变量后出现“bash:jq:commandnotfound”(windows)
我想curl "https://jsonplaceholder.typicode.com/users" | jq 按照本教程视频使用命令(在 bash 中)在本地测试 json 文件:https : //www.youtube.com/watch?v=rrjIVEpRqPI
我按照每个步骤并在 env 变量路径中添加了可执行文件,但根本不起作用,我得到了结果:
$ curl "https://jsonplaceholder.typicode.com/users" | jq
bash: jq: command not found
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4670 0 4670 0 0 8584 0 --:--:-- --:--:-- --:--:-- 8584
curl: (23) Failed writing body (795 != 1369)
我错过了什么吗?为什么我还是报错bash: jq: command not found??
回答
您可以从 git bash运行jq.exe。
你只需要在你的 git bash PATH 中安装它:
curl -L -o /usr/bin/jq.exe https://github.com/stedolan/jq/releases/latest/download/jq-win64.exe
然后 jq 将与您的管道命令一起使用。
THE END
二维码