Giter Site home page Giter Site logo

Comments (7)

heartsucker avatar heartsucker commented on August 24, 2024 1

From the README (which is also available via node-deb --show-readme):

Requirements

  • dpkg
  • fakeroot
  • jq

These are all available through apt and brew.

And yes, loading JSON in JS is trivially easy (or I assume it is), but I actually don't know any JS/Node and I wrote this as an admin who just wanted our deploys to be a little less messy. If I had to write this in JS, it probably wouldn't have ever existed. Such is life in the imperfect world of FOSS.

It is admittedly odd to use jq over writing it in JS, but this is the first time someone has had enough of a problem to say something in ~2 years.

If you think this is a deficiency of node-deb, please open a separate ticket so people can discuss the change to JS. As it is, whenever I make changes, I usually end up breaking other people's CI or workflow, and I try to be sensitive to that. Changing to adding a hard requirement on node warrants public discourse before deciding which way to go.

Because there is no way to guess why it does not work

And to be fair, there's not really any way to reliably predict that someone has the wrong binary executing from their path. In theory, you could install your own version of curl or node or anything else, and then we're in an extremely complex space where every script has to error check every shell command to ensure that the binary executing actually is the binary it thinks.

I have updated the README with commit 7d914f9 to include a link to the correct jq should someone else have a similar issue.

from node-deb.

milipili avatar milipili commented on August 24, 2024

Actually, the dependencies are just missing..

from node-deb.

heartsucker avatar heartsucker commented on August 24, 2024

Hey @milipili jq is actually a binary you can get from apt or brew.

$ node-deb
Error: Cannot find module 'commander'
$ sudo npm install -g commander
$ node-deb
Error: Cannot find module 'async'
$ sudo npm install -g async
$ node-deb
Error: Cannot find module 'rimraf'
Error: Cannot find module 'winston'
Error: Cannot find module 'colors'

I'm not sure where that error came from since node-deb is just an oversized bash script. It shouldn't be calling node ever or running and JS files. I'm not what's going on there. Can you do a vim $(which node-deb) and add the flag set -x to the top of the script. Then run it again and copy/paste the output to a Gist. Maybe that can help me debug.

from node-deb.

milipili avatar milipili commented on August 24, 2024

Hum I've installed jq via npm. After I've installed the deps it started but I was unable to make it work anyway (some exceptions somewhere).
I forgot to give my os: debian 9 stretch. nodejs installed via ppa (don't know if it changes anything).
Finally I've made the package manually. It. But I can retry on a fresh debian

from node-deb.

heartsucker avatar heartsucker commented on August 24, 2024

It looks like the npm package jq is just jQuery whereas the binary I'm talking about is this:
https://stedolan.github.io/jq/

I understand that it's a bit odd to use something other than node to process the JSON, but when I made this I was doing sys-admin work and just needed some bash to handle packing my company's apps for deployment. I could conceivably rewrite it in JS, but that's a whole 'nother issue.

heartsucker@pythagoras:~ (master)$ jq --version
jq-1.5-1-a5b5cbe

If you don't see that output, then you might have to uninstall whatever jq you installed with npm as it may have higher PATH precedence than your apt/brew packages.

from node-deb.

milipili avatar milipili commented on August 24, 2024

It is probably fine to install another package (even if loading json in js is a piece of cake so I don't really understand...). But the documentation should be updated. Because there is no way to guess why it does not work (well, or won't bother, like me today since I didn't have time for that)

from node-deb.

milipili avatar milipili commented on August 24, 2024

Well, first, if there is some documentation, people can figure out why it does not work as expected. So this ticket can be closed I guess.
That said, from a js point of view, I think indeed jq should be replaced by pure js.

from node-deb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.