Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

" bash: jq: command not found" after adding jq execuable file to env variable (windows) [duplicate]

I wanted to test a json file locally with command (in bash)curl "https://jsonplaceholder.typicode.com/users" | jq by following this tutorial video: https://www.youtube.com/watch?v=rrjIVepRqPI

I followed each step and added the executable file in the env variable path, but not working at all, I got result:

$ 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)

Am I missing anything? Why I still got error bash: jq: command not found??

like image 204
wawawa Avatar asked Dec 08 '20 15:12

wawawa


People also ask

Is jq available for Windows?

jq is written in C and has no runtime dependencies, so it should be possible to build it for nearly any platform. Prebuilt binaries are available for Linux, OS X and Windows.

What is jq command in bash?

jq command is used not only for reading JSON data but also to display data by removing the particular key. The following command will print all key values of Students. json file by excluding batch key. map and del function are used in jq command to do the task.


1 Answers

You can run a jq.exe from git bash.

You only need to install it in your git bash PATH:

curl -L -o /usr/bin/jq.exe https://github.com/stedolan/jq/releases/latest/download/jq-win64.exe

Then jq will work with your pipe command.

like image 74
VonC Avatar answered Sep 28 '22 10:09

VonC