@@ -31,7 +31,7 @@ export class PluginsService implements IPluginsService {
3131 } , PluginsService . NPM_CONFIG ) ;
3232 }
3333
34- constructor ( private $npm : INodePackageManager ,
34+ constructor ( private $packageManager : INodePackageManager ,
3535 private $fs : IFileSystem ,
3636 private $options : IOptions ,
3737 private $logger : ILogger ,
@@ -46,7 +46,7 @@ export class PluginsService implements IPluginsService {
4646 plugin = possiblePackageName ;
4747 }
4848
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 ;
5050 const pathToRealNpmPackageJson = path . join ( projectData . projectDir , "node_modules" , name , "package.json" ) ;
5151 const realNpmPackageJson = this . $fs . readJson ( pathToRealNpmPackageJson ) ;
5252
@@ -65,14 +65,14 @@ export class PluginsService implements IPluginsService {
6565 } catch ( err ) {
6666 // Revert package.json
6767 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 ) ;
6969
7070 throw err ;
7171 }
7272
7373 this . $logger . out ( `Successfully installed plugin ${ realNpmPackageJson . name } .` ) ;
7474 } else {
75- await this . $npm . uninstall ( realNpmPackageJson . name , { save : true } , projectData . projectDir ) ;
75+ await this . $packageManager . uninstall ( realNpmPackageJson . name , { save : true } , projectData . projectDir ) ;
7676 this . $errors . failWithoutHelp ( `${ plugin } is not a valid NativeScript plugin. Verify that the plugin package.json file contains a nativescript key and try again.` ) ;
7777 }
7878 }
@@ -181,7 +181,7 @@ export class PluginsService implements IPluginsService {
181181 const notInstalledDependencies = _ . difference ( allDependencies , installedDependencies ) ;
182182 if ( this . $options . force || notInstalledDependencies . length ) {
183183 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 , {
185185 disableNpmInstall : this . $options . disableNpmInstall ,
186186 frameworkPath : this . $options . frameworkPath ,
187187 ignoreScripts : this . $options . ignoreScripts ,
@@ -282,9 +282,9 @@ export class PluginsService implements IPluginsService {
282282
283283 private async executeNpmCommand ( npmCommandName : string , npmCommandArguments : string , projectData : IProjectData ) : Promise < string > {
284284 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 ) ;
286286 } 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 ) ;
288288 }
289289
290290 return this . parseNpmCommandResult ( npmCommandArguments ) ;
0 commit comments