Skip to content

Commit 2e775c5

Browse files
FatmeFatme
authored andcommitted
Merge pull request #874 from NativeScript/fatme/fix-ENOENT
Fixes "Error:Error: ENOENT, readdir '/private/var/lib/jenkins/workspace/tns-stable-build-testapps-android-full/TestApp/app/tns_modules'"
2 parents c9aacda + f5d80da commit 2e775c5

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/tools/broccoli/builder.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ export class Builder implements IBroccoliBuilder {
5656

5757
if(isNodeModulesModified && this.$fs.exists(absoluteOutputPath).wait()) {
5858
let currentPreparedTnsModules = this.$fs.readDirectory(absoluteOutputPath).wait();
59-
let tnsModulesInApp = this.$fs.readDirectory(path.join(projectDir, "app", "tns_modules")).wait();
59+
let tnsModulesPath = path.join(projectDir, "app", "tns_modules");
60+
if(!this.$fs.exists(tnsModulesPath).wait()) {
61+
tnsModulesPath = path.join(projectDir, "node_modules", "tns-core-modules");
62+
}
63+
let tnsModulesInApp = this.$fs.readDirectory(tnsModulesPath).wait();
6064
let modulesToDelete = _.difference(currentPreparedTnsModules, tnsModulesInApp);
6165
_.each(modulesToDelete, moduleName => this.$fs.deleteDirectory(path.join(absoluteOutputPath, moduleName)).wait());
6266
}

0 commit comments

Comments
 (0)