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 all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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("^[.~]{0,2}/.*"))) {
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