-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: npx node-jq #614
Comments
Hey, good idea. I published a next version where you can use already npx node-jq. Install it with It supports both names (node-jq and jq): We had issues in the past with the bin folder and bin property from packagejson, but lately npm has fixed those. I will push it as a minor as soon as more platforms are tested. Thanks for opening the issue |
Not sure if this is the right place to report this, but this seemed to work nicely on OSX, but on vanilla Ubuntu LTS I get an "Exec format error" when trying to run the binary that was downloaded with this package:
The current current published version seems to work nicely also on this Linux. |
I did some testing, and it seems that on Linux Installing [email protected] downloads a different binary package than [email protected] The one downloaded with 3.0.0 works (and is 3 953 824 bytes), one downloaded with 4.1.0-rc.2 does not work (and is only 864 040 bytes). |
It seems the current default version when installing from npm is v4.0.1 and it also downloads a working version of the binary on Ubuntu LTS. |
It seems I can reproduce this problem also using the following docker command and an older Ubuntu LTS image.
This results in "Exec format error" I managed to reproduce this on multiple machines with different network conditions (all in Finland though), so although the tests seem to be passing in Github, I am afraid that this is not just something on my machine. For some reason, and judging by the exact same file size, it looks like the versions that are now published as rc.1 and rc.2 are downloading the "jq-osx-amd64" version of the binary also on Linux. Same problem does not seen to occur with rc.0. |
A little unexpected. Can you check installing node-jq@4 vs node-jq@next? It should download the same binary with the exception that Try this steps: npm install node-jq@next rm -rf node_modules |
Currently also @next seems to be resulting in the bin directory having the darwin platform version for me. |
Released a rc3 that is tested on MacOS and Ubuntu and works fine. |
I can confirm that |
I think I have identified the problem with rc.2 and rc.1: When I run NODE_JQ_SKIP_INSTALL_BINARY=true npm install [email protected] I get an empty node_modules/node-jq/bin -directory. But when I run NODE_JQ_SKIP_INSTALL_BINARY=true npm install [email protected] I still get the darwin binary in my node_modules/node-jq/bin directory. From this I am guessing that for some reason the rc.1 and rc.2 releases shipped with the darwin binary already in the npm package, and this prevented the Linux version from installing the correct binary as a postinstall hook. It is a good thing that this is now fixed with rc.3, and maybe this experience also helps avoid this situation also with further npm releases :) We live and learn! Thank you very much for putting the hours in on this very useful project! |
Fixed in #615 |
I would like to be able to execute jq in a project directory after "npm i" with "npx node-jq" instead of pointing to ./node_modules/node-jq/bin/jq (or maybe ./node_modules/node-jq/bin/jq.exe depending on environment?)
The reason for this is that I would like to read less documentation, and have things just work according to what I believe are common expectations in the node environments.
I am not sure how easy this would be to achieve with the binary install process you have in place, but having this in place would make it easier to reach for jq as handy tool in project scripts, and maybe maintainers familiar with the space know a way to make this happen easily. Thanks!
The text was updated successfully, but these errors were encountered: