jq在Windows 10下使用任何命令崩溃 [英] jq crashing under Windows 10 using any command
问题描述
我已经在Mac/Unix上成功使用jq几年了,现在被要求将项目从Mac移植到Windows.
I've used jq on Mac/Unix successfully for several years and have now been asked to port a project from Mac to Windows.
我的问题是我无法在Windows下使用在Mac上完美运行的.json文件在jq中运行任何命令.
My problem is that I am unable to run any command in jq under Windows with the .json files that work perfectly on the Mac.
这包括最简单的命令:
jq -r. /path/to/json.json
jq -r . /path/to/json.json
所有命令都会导致jq崩溃.我正在运行Windows 10 Pro.
All commands cause a crash of jq. I'm running Windows 10 Pro.
我尝试过的事情:
-使用Chocolatey安装jq,并直接下载预编译的32位和64位二进制文件.
-Installing jq using chocolatey as well as downloading the precompiled 32-bit and 64-bit binaries directly.
-使用标准命令提示符,提升的命令提示符和PowerShell.
-Using a standard command prompt, an elevated command prompt and PowerShell.
.json文件都具有UTF-8编码,没有BOM,我已经尝试将它们与Windows和Unix行尾一起使用. jq会崩溃.
The .json files all have UTF-8 encoding without BOM and I've tried them with both Windows and Unix line endings. jq crashes regardless.
任何人都可以提供任何指导,说明为什么简单的Windows移植会带来问题,或者我可能忽略了一些简单的问题吗?
Can anyone please provide any guidance as to why a simple port to Windows would be so problematic, or maybe some simple issue I am overlooking?
谢谢
推荐答案
这包括最简单的命令:
This includes the simplest command:
jq -r. /path/to/json.json
jq -r . /path/to/json.json
要确定问题的本质,最好从一个更简单的命令开始,例如:
To ascertain the nature of the problem, it would probably be better to start with an even simpler command, such as:
jq -n .
如果失败,则可能是32位/64位不匹配.
If that fails, maybe there is a 32-bit/64-bit mismatch.
此外,在指定路径名时,您将必须使用Windows约定.
Also, when specifying pathnames, you will have to use Windows conventions.
请注意,jq 1.5无法处理长Windows路径名.您可以从Appveyor获取为Windows预编译的jq的更新版本,如以下所述 https://github.com/stedolan/jq/wiki/Installation# Windows-using-appveyor
Please note that jq 1.5 cannot handle long Windows pathnames. You can obtain a more recent version of jq pre-compiled for Windows from Appveyor, as explained at https://github.com/stedolan/jq/wiki/Installation#windows-using-appveyor
这篇关于jq在Windows 10下使用任何命令崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!