Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

    If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

    KeyNotFoundException when using pgscan

    Scheduled Pinned Locked Moved Support
    4 Posts 3 Posters 10 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ValentijnV Offline
      Valentijn
      last edited by

      Hi,

      We started using Proget and pgscan for our frontend code but get a KeyNotFoundException exception in pgscan\Inedo.DependencyScan\NpmDependencyScanner.cs line 81

      string version = npmDependencyPackage.Value.GetProperty("version").GetString();
      

      This is the bit of json from the lock-file it fails on and as you can see there is no version attribute.

      "node_modules/@vicrea-neuron/eslint-plugin": {
        "resolved": "packages/eslint-plugin",
        "link": true
      },
      

      With kind regards,

      Valentijn

      dean-houstonD 1 Reply Last reply Reply Quote 0
      • dean-houstonD Offline
        dean-houston inedo-engineer @Valentijn
        last edited by

        Hi @v-makkenze_6348 ,

        This is the first time I've seen a "link": true type entry in a lock file.

        The docs for package-lock.json aren't very clear for what this signifies, aside from:

        A flag to indicate that this is a symbolic link. If this is present, no other fields are specified, since the link target will also be included in the lockfile.

        Not sure how a "link" entry like that gets added to a lock file, but I think we should just skip it then? Basically add code in that loop that does this?

        if (npmDependencyPackage.Value.TryGetProperty("link", out var link) && link.GetBoolean() == true)
          continue;
        

        What do you think?

        Cheers,
        Dean

        ValentijnV 1 Reply Last reply Reply Quote 0
        • ValentijnV Offline
          Valentijn @dean-houston
          last edited by Valentijn

          @dean-houston

          This was a package that came from a local workspace, skipping seems the right solution as you can never check these packages for vulnerabilities.

          1 Reply Last reply Reply Quote 0
          • rhessingerR Offline
            rhessinger inedo-engineer
            last edited by

            Hi @v-makkenze_6348,

            This fix has been released in pgscan 1.5.7. Please let us know if you have any questions!

            Thanks,
            Rich

            Products Engineer, Inedo

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post
            Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation