diff --git a/plugins/package-managers/node/src/main/kotlin/Npm.kt b/plugins/package-managers/node/src/main/kotlin/Npm.kt index 4a4f890958ad9..6c6aedce9ace1 100644 --- a/plugins/package-managers/node/src/main/kotlin/Npm.kt +++ b/plugins/package-managers/node/src/main/kotlin/Npm.kt @@ -247,7 +247,8 @@ open class Npm( logger.info { "Searching for 'package.json' files in '$nodeModulesDir'..." } val nodeModulesFiles = nodeModulesDir.walk().maxDepth(modulesSearchDepth).filter { - it.name == "package.json" && isValidNodeModulesDirectory(nodeModulesDir, nodeModulesDirForPackageJson(it)) + it.isFile && it.name == "package.json" && + isValidNodeModulesDirectory(nodeModulesDir, nodeModulesDirForPackageJson(it)) } return runBlocking(Dispatchers.IO) {