@@ -143,7 +143,7 @@ export default class InstallManager {
143143
144144 /**
145145 * If the "(p)npm-local" symlink hasn't been set up yet, this creates it, installing the
146- * specified PNPM or NPM version in the user's home directory if needed.
146+ * specified NPM version in the user's home directory if needed.
147147 */
148148 public ensureLocalPackageManager ( forceReinstall : boolean ) : void {
149149 // Example: "C:\Users\YourName\.rush"
@@ -157,10 +157,10 @@ export default class InstallManager {
157157 const packageManager : PackageManager = this . _rushConfiguration . packageManager ;
158158 const packageManagerVersion : string = this . _rushConfiguration . packageManagerToolVersion ;
159159
160- // Example: "C:\Users\YourName\.rush\pnpm -1.2.3"
160+ // Example: "C:\Users\YourName\.rush\npm -1.2.3"
161161 const packageManagerToolFolder : string = path . join ( rushHomeFolder ,
162162 `${ packageManager } -${ packageManagerVersion } ` ) ;
163- // Example: "C:\Users\YourName\.rush\pnpm -1.2.3\last-install.flag"
163+ // Example: "C:\Users\YourName\.rush\npm -1.2.3\last-install.flag"
164164 const packageManagerToolFlagFile : string = path . join ( packageManagerToolFolder , 'last-install.flag' ) ;
165165
166166 // NOTE: We don't care about the timestamp for last-install.flag, because nobody will change
@@ -188,7 +188,7 @@ export default class InstallManager {
188188 fsx . mkdirsSync ( this . _rushConfiguration . commonTempFolder ) ;
189189 }
190190
191- // Example: "C:\MyRepo\common\temp\pnpm -local"
191+ // Example: "C:\MyRepo\common\temp\npm -local"
192192 const localPackageManagerToolFolder : string =
193193 path . join ( this . _rushConfiguration . commonTempFolder , `${ packageManager } -local` ) ;
194194 if ( fsx . existsSync ( localPackageManagerToolFolder ) ) {
@@ -496,9 +496,6 @@ export default class InstallManager {
496496 }
497497 }
498498
499- // @todo for PNPM, we should look at the lock file to determine if the store needs to be cleaned
500- // ie even if the marker file does not exist, the store may be ok if there is no lock file
501-
502499 // If "--clean" or "--full-clean" was specified, or if the last install was interrupted,
503500 // then we will need to delete the node_modules folder. Otherwise, we can do an incremental
504501 // install.
@@ -530,18 +527,12 @@ export default class InstallManager {
530527 return ;
531528 }
532529 } else {
533- if ( this . _rushConfiguration . packageManager === 'npm' ) {
534- console . log ( `Deleting the "npm-cache" folder` ) ;
535- // This is faster and more thorough than "npm cache clean"
536- this . _asyncRecycler . moveFolder ( this . _rushConfiguration . npmCacheFolder ) ;
537-
538- console . log ( `Deleting the "npm-tmp" folder` ) ;
539- this . _asyncRecycler . moveFolder ( this . _rushConfiguration . npmTmpFolder ) ;
530+ console . log ( `Deleting the "npm-cache" folder` ) ;
531+ // This is faster and more thorough than "npm cache clean"
532+ this . _asyncRecycler . moveFolder ( this . _rushConfiguration . npmCacheFolder ) ;
540533
541- } else {
542- console . log ( `Deleting the "pnpm-store" folder` ) ;
543- this . _asyncRecycler . moveFolder ( this . _rushConfiguration . pnpmStoreFolder ) ;
544- }
534+ console . log ( `Deleting the "npm-tmp" folder` ) ;
535+ this . _asyncRecycler . moveFolder ( this . _rushConfiguration . npmTmpFolder ) ;
545536 }
546537
547538 if ( fsx . existsSync ( this . commonNodeModulesMarkerFilename ) ) {
@@ -575,15 +566,12 @@ export default class InstallManager {
575566 } else {
576567 // NO: Do an incremental install in the "node_modules" folder
577568
578- // note: it is not necessary to run "prune" with pnpm
579- if ( this . _rushConfiguration . packageManager === 'npm' ) {
580- console . log ( `Running "${ this . _rushConfiguration . packageManager } prune"`
581- + ` in ${ this . _rushConfiguration . commonTempFolder } ` ) ;
582- const args : string [ ] = [ 'prune' ] ;
583- this . pushConfigurationArgs ( args ) ;
584- Utilities . executeCommandWithRetry ( packageManagerFilename , args , MAX_INSTALL_ATTEMPTS ,
585- this . _rushConfiguration . commonTempFolder ) ;
586- }
569+ console . log ( `Running "${ this . _rushConfiguration . packageManager } prune"`
570+ + ` in ${ this . _rushConfiguration . commonTempFolder } ` ) ;
571+ const args : string [ ] = [ 'prune' ] ;
572+ this . pushConfigurationArgs ( args ) ;
573+ Utilities . executeCommandWithRetry ( packageManagerFilename , args , MAX_INSTALL_ATTEMPTS ,
574+ this . _rushConfiguration . commonTempFolder ) ;
587575
588576 // Delete the (installed image of) the temp projects, since "npm install" does not
589577 // detect changes for "file:./" references.
@@ -626,9 +614,6 @@ export default class InstallManager {
626614 // One possible solution would be to have the shrinkwrap include information about whether the dependency
627615 // is optional or not, but it does not appear to do so. Also, this would result in strange behavior where
628616 // people would have different node_modules based on their system.
629- //
630- // NOTE FOR PNPM:
631- // PNPM does not appear to support the --no-optional flag at the moment
632617
633618 const installArgs : string [ ] = [ 'install' ] ;
634619 if ( this . _rushConfiguration . packageManager === 'npm' ) {
@@ -658,13 +643,8 @@ export default class InstallManager {
658643 * to the command-line.
659644 */
660645 public pushConfigurationArgs ( args : string [ ] ) : void {
661- if ( this . _rushConfiguration . packageManager === 'npm' ) {
662- args . push ( '--cache' , this . _rushConfiguration . npmCacheFolder ) ;
663- args . push ( '--tmp' , this . _rushConfiguration . npmTmpFolder ) ;
664- } else if ( this . _rushConfiguration . packageManager === 'pnpm' ) {
665- args . push ( '--store' , this . _rushConfiguration . pnpmStoreFolder ) ;
666- args . push ( '--no-lock' ) ;
667- }
646+ args . push ( '--cache' , this . _rushConfiguration . npmCacheFolder ) ;
647+ args . push ( '--tmp' , this . _rushConfiguration . npmTmpFolder ) ;
668648 }
669649
670650 /**
0 commit comments