我想使用命令(在 bash 中)在本地测试 json 文件
curl "https://jsonplaceholder.typicode.com/users" | jq
,请按照本教程视频进行操作:https://www.youtube.com/watch?v=rrjIVepRqPI
我按照每一步操作,将可执行文件添加到环境变量路径中,但根本不起作用,我得到了结果:
$ 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 将使用您的管道命令。