Git Product home page Git Product logo

Comments (4)

jonabc avatar jonabc commented on May 26, 2024

@ispringer thanks for the report!

A more informative error message sounds like a great idea. if you'd like to open a PR fixing this that would be great. Otherwise I'm not sure when I'll have a chance to get to it.

FYI for more short-term investigation purposes, the parsed json comes from npm list --json --production --long

from licensed.

ispringer avatar ispringer commented on May 26, 2024

Hi @jonabc,

Thanks for the reply. I ran that command and I got a bunch of errors on stderr. The errors appear to be because my package.json file is actually intended for yarn, and uses some syntax that is not npm-compatible. Note, I was able to parse the JSON from stdout without any errors using JSON.parse via node, so maybe Licensed is trying to parse both stdout+stderr, rather than only stdout, as JSON?

from licensed.

jonabc avatar jonabc commented on May 26, 2024

@ispringer Licensed only parses stdout, but intentionally does not use stdout from shell commands that exit with an error code. This avoids picking up information that might be incorrect or out of date if a CLI tool finds an error.

So it sounds like there are two things that would be helpful here

  1. a yarn source that is different from the npm source that is being used
    • it looks like yarn.lock is the indicator that yarn is used in the local directory
  2. a more helpful error message when the npm command fails or output can't be parsed.

I'll open a new issue to create a yarn source to track that request separately.

from licensed.

mislav avatar mislav commented on May 26, 2024

A friendlier error message from npm (and other shelled-out commands) is now a reality: #38.

from licensed.

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.