@@ -432,16 +432,12 @@ export class RushPnpmCommandLineParser {
432432 const rushConfiguration : RushConfiguration = this . _rushConfiguration ;
433433 const workspaceFolder : string = this . _subspace . getSubspaceTempFolderPath ( ) ;
434434 const pnpmEnvironmentMap : EnvironmentMap = new EnvironmentMap ( process . env ) ;
435-
436- // Pass pnpm configuration as CLI args rather than NPM_CONFIG_* environment variables.
437- // Using env vars like NPM_CONFIG_STORE_DIR would cause "Unknown env config" warnings
438- // when pnpm internally delegates to npm (e.g. during publish operations).
439- const pnpmConfigArgs : string [ ] = [ `--config.workspaceDir=${ workspaceFolder } ` ] ;
435+ pnpmEnvironmentMap . set ( 'NPM_CONFIG_WORKSPACE_DIR' , workspaceFolder ) ;
440436
441437 if ( rushConfiguration . pnpmOptions . pnpmStorePath ) {
442- pnpmConfigArgs . push ( `--store-dir= ${ rushConfiguration . pnpmOptions . pnpmStorePath } ` ) ;
443- pnpmConfigArgs . push ( `--config.cacheDir= ${ rushConfiguration . pnpmOptions . pnpmStorePath } ` ) ;
444- pnpmConfigArgs . push ( `--config.stateDir= ${ rushConfiguration . pnpmOptions . pnpmStorePath } ` ) ;
438+ pnpmEnvironmentMap . set ( 'NPM_CONFIG_STORE_DIR' , rushConfiguration . pnpmOptions . pnpmStorePath ) ;
439+ pnpmEnvironmentMap . set ( 'NPM_CONFIG_CACHE_DIR' , rushConfiguration . pnpmOptions . pnpmStorePath ) ;
440+ pnpmEnvironmentMap . set ( 'NPM_CONFIG_STATE_DIR' , rushConfiguration . pnpmOptions . pnpmStorePath ) ;
445441 }
446442
447443 if ( rushConfiguration . pnpmOptions . environmentVariables ) {
@@ -477,7 +473,7 @@ export class RushPnpmCommandLineParser {
477473 try {
478474 const { exitCode } = await Utilities . executeCommandAsync ( {
479475 command : rushConfiguration . packageManagerToolFilename ,
480- args : [ ... pnpmConfigArgs , ... this . _pnpmArgs ] ,
476+ args : this . _pnpmArgs ,
481477 workingDirectory : process . cwd ( ) ,
482478 environment : pnpmEnvironmentMap . toObject ( ) ,
483479 keepEnvironment : true ,
0 commit comments