diff --git a/lib/npm-installation-manager.ts b/lib/npm-installation-manager.ts index 834c06104b..a2db18e9b6 100644 --- a/lib/npm-installation-manager.ts +++ b/lib/npm-installation-manager.ts @@ -2,6 +2,7 @@ import * as path from "path"; import * as semver from "semver"; import * as npm from "npm"; import * as constants from "./constants"; +import {sleep} from "../lib/common/helpers"; export class NpmInstallationManager implements INpmInstallationManager { private static NPM_LOAD_FAILED = "Failed to retrieve data from npm. Please try again a little bit later."; @@ -107,8 +108,8 @@ export class NpmInstallationManager implements INpmInstallationManager { public install(packageName: string, opts?: INpmInstallOptions): IFuture { return (() => { - while (this.$lockfile.check().wait()) { - ; + while(this.$lockfile.check().wait()) { + sleep(10); } this.$lockfile.lock().wait(); diff --git a/lib/tools/broccoli/builder.ts b/lib/tools/broccoli/builder.ts index cf88bc7f86..309e29d17e 100644 --- a/lib/tools/broccoli/builder.ts +++ b/lib/tools/broccoli/builder.ts @@ -5,6 +5,7 @@ import * as shelljs from "shelljs"; import Future = require("fibers/future"); import * as destCopyLib from "./node-modules-dest-copy"; import * as fiberBootstrap from "../../common/fiber-bootstrap"; +import {sleep} from "../../../lib/common/helpers"; let glob = require("glob"); @@ -35,8 +36,8 @@ export class Builder implements IBroccoliBuilder { }, (er: Error, files: string[]) => { fiberBootstrap.run(() => { - while (this.$lockfile.check().wait()) { - ; + while(this.$lockfile.check().wait()) { + sleep(10); } this.$lockfile.lock().wait();