Skip to content

fix(javascript): remove debug print statement in dependency parser#4412

Merged
wagoodman merged 1 commit intoanchore:mainfrom
cgreeno:fix/remove-debug-print-javascript-dependency
Dec 10, 2025
Merged

fix(javascript): remove debug print statement in dependency parser#4412
wagoodman merged 1 commit intoanchore:mainfrom
cgreeno:fix/remove-debug-print-javascript-dependency

Conversation

@cgreeno
Copy link
Contributor

@cgreeno cgreeno commented Nov 26, 2025

Summary

Removes an accidental fmt.Println("error", err) that was left in the javascript dependency parser from PR #4304.

This causes noisy output to stdout when parsing npm package-lock.json files that contain dependency specifiers that aren't valid PURLs (e.g., empty strings or version ranges).

Example of the noise

When scanning a repository with npm dependencies:

error purl scheme is not "pkg": ""
error purl scheme is not "pkg": ""
error purl scheme is not "pkg": ""
... (repeated hundreds of times)

Fix

Simply remove the debug print statement - the error case is already handled correctly (the dependency is still added via requires = append(requires, name) on line 34).

Testing

  • Verified that repositories with npm dependencies no longer produce noisy output
  • The actual dependency parsing logic is unchanged

Removes an accidental `fmt.Println("error", err)` that was left in
the javascript dependency parser. This causes noisy output to stdout
when parsing npm package-lock.json files that contain dependency
specifiers that aren't valid PURLs.

Signed-off-by: Chris Greeno <chris@fresha.com>
@wagoodman wagoodman merged commit 568b760 into anchore:main Dec 10, 2025
7 checks passed
@wagoodman wagoodman added the bug Something isn't working label Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants