@@ -7,7 +7,9 @@ export class PacoteService implements IPacoteService {
77 constructor ( private $fs : IFileSystem ,
88 private $injector : IInjector ,
99 private $logger : ILogger ,
10- private $proxyService : IProxyService ) { }
10+ private $npmConfigService : INpmConfigService ,
11+ private $proxyService : IProxyService ) {
12+ }
1113
1214 @cache ( )
1315 public get $packageManager ( ) : INodePackageManager {
@@ -18,13 +20,16 @@ export class PacoteService implements IPacoteService {
1820 public async manifest ( packageName : string , options ?: IPacoteManifestOptions ) : Promise < any > {
1921 this . $logger . trace ( `Calling pacoteService.manifest for packageName: '${ packageName } ' and options: ${ options } ` ) ;
2022 const manifestOptions : IPacoteBaseOptions = await this . getPacoteBaseOptions ( ) ;
23+
2124 if ( options ) {
2225 _ . extend ( manifestOptions , options ) ;
2326 }
2427
2528 packageName = this . getRealPackageName ( packageName ) ;
2629 this . $logger . trace ( `Calling pacote.manifest for packageName: ${ packageName } and options: ${ JSON . stringify ( manifestOptions , null , 2 ) } ` ) ;
27- return pacote . manifest ( packageName , manifestOptions ) ;
30+ const result = pacote . manifest ( packageName , manifestOptions ) ;
31+
32+ return result ;
2833 }
2934
3035 public async extractPackage ( packageName : string , destinationDirectory : string , options ?: IPacoteExtractOptions ) : Promise < void > {
@@ -67,7 +72,10 @@ export class PacoteService implements IPacoteService {
6772 private async getPacoteBaseOptions ( ) : Promise < IPacoteBaseOptions > {
6873 // In case `tns create myapp --template https://github.com/NativeScript/template-hello-world.git` command is executed, pacote module throws an error if cache option is not provided.
6974 const cachePath = await this . $packageManager . getCachePath ( ) ;
70- const pacoteOptions = { cache : cachePath } ;
75+
76+ // Add NPM Configuration to our Manifest options
77+ const npmConfig = this . $npmConfigService . getConfig ( ) ;
78+ const pacoteOptions = _ . extend ( npmConfig , { cache : cachePath } ) ;
7179 const proxySettings = await this . $proxyService . getCache ( ) ;
7280 if ( proxySettings ) {
7381 _ . extend ( pacoteOptions , proxySettings ) ;
0 commit comments