jq実行可能ファイルを環境変数(windows)に追加した後の「bash:jq:コマンドが見つかりません」[重複]
Dec 08 2020
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
か?
回答
VonC Dec 09 2020 at 14:19
from gitbashを実行jq.exeできます。
あなたはそれをあなたのgitbashPATHにインストールする必要があるだけです:
curl -L -o /usr/bin/jq.exe https://github.com/stedolan/jq/releases/latest/download/jq-win64.exe
その後、jqはpipeコマンドで動作します。