1
1
import * as path from "path" ;
2
2
import * as semver from "semver" ;
3
3
import * as constants from "./constants" ;
4
- import { sleep } from "../lib/common/helpers" ;
5
4
6
5
export class NpmInstallationManager implements INpmInstallationManager {
7
6
private static NPM_LOAD_FAILED = "Failed to retrieve data from npm. Please try again a little bit later." ;
8
7
9
8
constructor ( private $npm : INodePackageManager ,
10
9
private $logger : ILogger ,
11
- private $lockfile : ILockFile ,
12
10
private $errors : IErrors ,
13
11
private $options : IOptions ,
14
12
private $fs : IFileSystem ,
@@ -44,13 +42,6 @@ export class NpmInstallationManager implements INpmInstallationManager {
44
42
public install ( packageName : string , projectDir : string , opts ?: INpmInstallOptions ) : IFuture < any > {
45
43
return ( ( ) => {
46
44
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
-
54
45
try {
55
46
let packageToInstall = this . $options . frameworkPath || packageName ;
56
47
let pathToSave = projectDir ;
@@ -61,8 +52,6 @@ export class NpmInstallationManager implements INpmInstallationManager {
61
52
} catch ( error ) {
62
53
this . $logger . debug ( error ) ;
63
54
this . $errors . fail ( "%s. Error: %s" , NpmInstallationManager . NPM_LOAD_FAILED , error ) ;
64
- } finally {
65
- this . $lockfile . unlock ( ) . wait ( ) ;
66
55
}
67
56
68
57
} ) . future < string > ( ) ( ) ;
0 commit comments