diff --git a/.changeset/hot-kangaroos-matter.md b/.changeset/hot-kangaroos-matter.md new file mode 100644 index 0000000000..7b7a13b380 --- /dev/null +++ b/.changeset/hot-kangaroos-matter.md @@ -0,0 +1,5 @@ +--- +"pnpm": patch +--- + +Do not retry requests, when checking for new versions of pnpm. diff --git a/packages/pnpm/src/checkForUpdates.ts b/packages/pnpm/src/checkForUpdates.ts index 9d6786c9c6..12a7564c7a 100644 --- a/packages/pnpm/src/checkForUpdates.ts +++ b/packages/pnpm/src/checkForUpdates.ts @@ -32,13 +32,10 @@ export default async function (config: Config) { ...config, authConfig: config.rawConfig, retry: { - factor: config.fetchRetryFactor, - maxTimeout: config.fetchRetryMaxtimeout, - minTimeout: config.fetchRetryMintimeout, - retries: config.fetchRetries, + retries: 0, }, storeDir, - timeout: config.fetchTimeout, + timeout: 3000, }) const resolution = await resolve({ alias: packageManager.name, pref: 'latest' }, { lockfileDir: config.lockfileDir ?? config.dir, diff --git a/packages/pnpm/src/main.ts b/packages/pnpm/src/main.ts index 0b607a3e05..f81e80fb26 100644 --- a/packages/pnpm/src/main.ts +++ b/packages/pnpm/src/main.ts @@ -202,7 +202,8 @@ export default async function run (inputArgv: string[]) { // Don't check for updates // 1. on CI environments // 2. when in the middle of an actual update - if (!isCI && !selfUpdate) { + // 3. when the CLI is running in offline mode + if (!isCI && !selfUpdate && !config.offline && !config.preferOffline) { checkForUpdates(config).catch(() => { /* Ignore */ }) }