diff --git a/packages/puppeteer-core/src/node/BrowserFetcher.ts b/packages/puppeteer-core/src/node/BrowserFetcher.ts index 493518ad5e0..c96b327045f 100644 --- a/packages/puppeteer-core/src/node/BrowserFetcher.ts +++ b/packages/puppeteer-core/src/node/BrowserFetcher.ts @@ -504,6 +504,13 @@ export class BrowserFetcher { #getFolderPath(revision: string): string { return path.resolve(this.#downloadPath, `${this.#platform}-${revision}`); } + + /** + * @internal + */ + getDownloadPath(): string { + return this.#downloadPath; + } } function parseFolderPath( diff --git a/packages/puppeteer/src/node/install.ts b/packages/puppeteer/src/node/install.ts index 25b317058ef..8011e02e97e 100644 --- a/packages/puppeteer/src/node/install.ts +++ b/packages/puppeteer/src/node/install.ts @@ -94,13 +94,18 @@ export async function downloadBrowser(): Promise { logPolitely( `${supportedProducts[product]} (${revisionInfo.revision}) downloaded to ${revisionInfo.folderPath}` ); - localRevisions = localRevisions.filter(revision => { + const otherRevisions = localRevisions.filter(revision => { return revision !== revisionInfo.revision; }); - const cleanupOldVersions = localRevisions.map(revision => { - return browserFetcher.remove(revision); - }); - Promise.all([...cleanupOldVersions]); + if (otherRevisions.length) { + logPolitely( + `Other installed ${ + supportedProducts[product] + } browsers in ${browserFetcher.getDownloadPath()} include: ${otherRevisions.join( + ', ' + )}. Remove old revisions from ${browserFetcher.getDownloadPath()} if you don't need them.` + ); + } } function onError(error: Error) {