From 73499a6953eb0d71a92562bd2457fb29349ab6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Nison?= Date: Thu, 22 Jun 2017 18:24:57 +0100 Subject: [PATCH] Fixes resolution concurrency problem (#3673) --- src/package-request.js | 5 ++++- src/package-resolver.js | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/package-request.js b/src/package-request.js index 8930c0aa90..054cff3b96 100644 --- a/src/package-request.js +++ b/src/package-request.js @@ -343,7 +343,10 @@ export default class PackageRequest { } } - await Promise.all(promises); + for (const promise of promises) { + await promise; + } + ref.addDependencies(deps); // Now that we have all dependencies, it's safe to propagate optional diff --git a/src/package-resolver.js b/src/package-resolver.js index 47fb2ac23d..11f8b31682 100644 --- a/src/package-resolver.js +++ b/src/package-resolver.js @@ -471,7 +471,10 @@ export default class PackageResolver { this.frozen = Boolean(isFrozen); this.workspaceLayout = workspaceLayout; const activity = (this.activity = this.reporter.activity()); - await Promise.all(deps.map((req): Promise => this.find(req))); + + for (const req of deps) { + await this.find(req); + } // all required package versions have been discovered, so now packages that // resolved to existing versions can be resolved to their best available version