Member-only story
Troubleshooting a Linux/Unix/Mac error ‘jq: error: May need parentheses around object key expression at <top-level>, line 1:’
Here is another interesting error I encountered while working to create a newly customized JSON file with jq command. jq command, as some of you may know, is an Unix that can run in Linux/UNIX/MacOS that can help to create, to edit, and to play with JSON (Javascript Object Notation) files.
Anyway, I was getting a following error while trying to create a JSON file.
jq: error: May need parentheses around object key expression at <top-level>, line 1:
What is happening is that a variable based key, which is $version in this case, needs to be wrapped around in parentheses. Thus, it will be like this:
That was it! Although it looks quite simple, I know it can come in handy sometime :)