@@ -31,7 +31,7 @@ export class PluginsService implements IPluginsService {
31
31
} , PluginsService . NPM_CONFIG ) ;
32
32
}
33
33
34
- constructor ( private $npm : INodePackageManager ,
34
+ constructor ( private $packageManager : INodePackageManager ,
35
35
private $fs : IFileSystem ,
36
36
private $options : IOptions ,
37
37
private $logger : ILogger ,
@@ -46,7 +46,7 @@ export class PluginsService implements IPluginsService {
46
46
plugin = possiblePackageName ;
47
47
}
48
48
49
- const name = ( await this . $npm . install ( plugin , projectData . projectDir , this . npmInstallOptions ) ) . name ;
49
+ const name = ( await this . $packageManager . install ( plugin , projectData . projectDir , this . npmInstallOptions ) ) . name ;
50
50
const pathToRealNpmPackageJson = path . join ( projectData . projectDir , "node_modules" , name , "package.json" ) ;
51
51
const realNpmPackageJson = this . $fs . readJson ( pathToRealNpmPackageJson ) ;
52
52
@@ -65,14 +65,14 @@ export class PluginsService implements IPluginsService {
65
65
} catch ( err ) {
66
66
// Revert package.json
67
67
this . $projectDataService . removeNSProperty ( projectData . projectDir , this . $pluginVariablesService . getPluginVariablePropertyName ( pluginData . name ) ) ;
68
- await this . $npm . uninstall ( plugin , PluginsService . NPM_CONFIG , projectData . projectDir ) ;
68
+ await this . $packageManager . uninstall ( plugin , PluginsService . NPM_CONFIG , projectData . projectDir ) ;
69
69
70
70
throw err ;
71
71
}
72
72
73
73
this . $logger . out ( `Successfully installed plugin ${ realNpmPackageJson . name } .` ) ;
74
74
} else {
75
- await this . $npm . uninstall ( realNpmPackageJson . name , { save : true } , projectData . projectDir ) ;
75
+ await this . $packageManager . uninstall ( realNpmPackageJson . name , { save : true } , projectData . projectDir ) ;
76
76
this . $errors . failWithoutHelp ( `${ plugin } is not a valid NativeScript plugin. Verify that the plugin package.json file contains a nativescript key and try again.` ) ;
77
77
}
78
78
}
@@ -181,7 +181,7 @@ export class PluginsService implements IPluginsService {
181
181
const notInstalledDependencies = _ . difference ( allDependencies , installedDependencies ) ;
182
182
if ( this . $options . force || notInstalledDependencies . length ) {
183
183
this . $logger . trace ( "Npm install will be called from CLI. Force option is: " , this . $options . force , " Not installed dependencies are: " , notInstalledDependencies ) ;
184
- await this . $npm . install ( projectData . projectDir , projectData . projectDir , {
184
+ await this . $packageManager . install ( projectData . projectDir , projectData . projectDir , {
185
185
disableNpmInstall : this . $options . disableNpmInstall ,
186
186
frameworkPath : this . $options . frameworkPath ,
187
187
ignoreScripts : this . $options . ignoreScripts ,
@@ -282,9 +282,9 @@ export class PluginsService implements IPluginsService {
282
282
283
283
private async executeNpmCommand ( npmCommandName : string , npmCommandArguments : string , projectData : IProjectData ) : Promise < string > {
284
284
if ( npmCommandName === PluginsService . INSTALL_COMMAND_NAME ) {
285
- await this . $npm . install ( npmCommandArguments , projectData . projectDir , this . npmInstallOptions ) ;
285
+ await this . $packageManager . install ( npmCommandArguments , projectData . projectDir , this . npmInstallOptions ) ;
286
286
} else if ( npmCommandName === PluginsService . UNINSTALL_COMMAND_NAME ) {
287
- await this . $npm . uninstall ( npmCommandArguments , PluginsService . NPM_CONFIG , projectData . projectDir ) ;
287
+ await this . $packageManager . uninstall ( npmCommandArguments , PluginsService . NPM_CONFIG , projectData . projectDir ) ;
288
288
}
289
289
290
290
return this . parseNpmCommandResult ( npmCommandArguments ) ;
0 commit comments