From 9ce89917d74345692ef82dc68004e301eea6e03f Mon Sep 17 00:00:00 2001 From: andersnm Date: Sun, 21 Apr 2019 20:14:40 +0200 Subject: [PATCH] Do not stat non-existent dir --- packages/blerf/src/commands/build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/blerf/src/commands/build.ts b/packages/blerf/src/commands/build.ts index fd0fd7a..0d55683 100644 --- a/packages/blerf/src/commands/build.ts +++ b/packages/blerf/src/commands/build.ts @@ -251,7 +251,7 @@ export class BuildEnumerator extends PackageEnumerator { if (dependencyVersion.startsWith("file:")) { const dependencyNodePath = path.join(packagePath, "node_modules", dependencyName); - if (!fs.lstatSync(dependencyNodePath).isSymbolicLink()) { + if (fs.existsSync(dependencyNodePath) && !fs.lstatSync(dependencyNodePath).isSymbolicLink()) { console.log("blerf: recovering from npm error scenario: 'file:'-dependency exists in node_modules, but is not a symlink"); this.rimraf(dependencyNodePath); recovered = true;