11import * as path from "path" ;
22import * as semver from "semver" ;
33import * as constants from "./constants" ;
4- import { sleep } from "../lib/common/helpers" ;
54
65export class NpmInstallationManager implements INpmInstallationManager {
76 private static NPM_LOAD_FAILED = "Failed to retrieve data from npm. Please try again a little bit later." ;
87
98 constructor ( private $npm : INodePackageManager ,
109 private $logger : ILogger ,
11- private $lockfile : ILockFile ,
1210 private $errors : IErrors ,
1311 private $options : IOptions ,
1412 private $fs : IFileSystem ,
@@ -44,13 +42,6 @@ export class NpmInstallationManager implements INpmInstallationManager {
4442 public install ( packageName : string , projectDir : string , opts ?: INpmInstallOptions ) : IFuture < any > {
4543 return ( ( ) => {
4644
47- // TODO: plamen5kov: figure a way to remove this
48- while ( this . $lockfile . check ( ) . wait ( ) ) {
49- sleep ( 10 ) ;
50- }
51-
52- this . $lockfile . lock ( ) . wait ( ) ;
53-
5445 try {
5546 let packageToInstall = this . $options . frameworkPath || packageName ;
5647 let pathToSave = projectDir ;
@@ -61,8 +52,6 @@ export class NpmInstallationManager implements INpmInstallationManager {
6152 } catch ( error ) {
6253 this . $logger . debug ( error ) ;
6354 this . $errors . fail ( "%s. Error: %s" , NpmInstallationManager . NPM_LOAD_FAILED , error ) ;
64- } finally {
65- this . $lockfile . unlock ( ) . wait ( ) ;
6655 }
6756
6857 } ) . future < string > ( ) ( ) ;
0 commit comments