env 변수에 jq 실행 파일을 추가 한 후 "bash : jq : 명령을 찾을 수 없음"(Windows) [중복]

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

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가 파이프 명령과 함께 작동합니다.