Skip to content
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

Added local node_module check for NodePackageAnalyzer #4753

Merged
merged 3 commits into from Aug 19, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -297,10 +297,10 @@ public static boolean shouldSkipDependency(String name, String version, boolean

// this seems to produce crash sometimes, I need to tests
// using a local node_module is not supported by npm audit, it crash
if (Objects.nonNull(version) && version.startsWith("file:")) {
if (Objects.nonNull(version) && (version.startsWith("file:") || version.matches("^[.~]*/.*"))) {
jeremylong marked this conversation as resolved.
Show resolved Hide resolved
LOGGER.warn("dependency skipped: package.json contain an local node_module for {} seems to be "
+ "located {} npm audit doesn't support locally referenced modules",
name, version.replace("file:", ""));
name, version);
return true;
}
return false;
Expand Down