diff --git a/plugins/org.eclipse.n4js/src/org/eclipse/n4js/utils/ProjectDiscoveryHelper.java b/plugins/org.eclipse.n4js/src/org/eclipse/n4js/utils/ProjectDiscoveryHelper.java index f627ee01ed..b35af93394 100644 --- a/plugins/org.eclipse.n4js/src/org/eclipse/n4js/utils/ProjectDiscoveryHelper.java +++ b/plugins/org.eclipse.n4js/src/org/eclipse/n4js/utils/ProjectDiscoveryHelper.java @@ -431,7 +431,6 @@ private Set collectNecessaryDependencies(Set allProjectDirs, Map allProjectDirs, Path projectDir, Map pdCache, Set dependencies) { - NodeModulesFolder nodeModulesFolder = nodeModulesDiscoveryHelper.getNodeModulesFolder(projectDir, pdCache); LinkedHashSet workList = new LinkedHashSet<>(); workList.add(projectDir); while (!workList.isEmpty()) { @@ -439,6 +438,7 @@ private void collectProjectDependencies(Set allProjectDirs, Path projectDi Path nextProject = iterator.next(); iterator.remove(); + NodeModulesFolder nodeModulesFolder = nodeModulesDiscoveryHelper.getNodeModulesFolder(nextProject, pdCache); findDependencies(allProjectDirs, nextProject, nodeModulesFolder, pdCache, workList, dependencies); } }