{"record":{"id":"53809d46dffde22f","repo":"upstash/context7","slug":"couldn-t-check-for-updates-right-now","errorCode":null,"errorMessage":"Couldn't check for updates right now.","messagePattern":"Couldn't check for updates right now\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/cli/src/commands/upgrade.ts","lineNumber":130,"sourceCode":"  }\n\n  log.box([\n    `${pc.white(pc.bold(\"Update available:\"))} ${pc.green(pc.bold(`v${info.currentVersion}`))} ${pc.dim(\"->\")} ${pc.green(pc.bold(`v${info.latestVersion}`))}`,\n    `${pc.white(\"Run\")} ${pc.yellow(pc.bold(\"ctx7 upgrade\"))} ${pc.white(\"to update now\")}`,\n    `${pc.white(\"Or run\")} ${pc.yellow(info.upgradePlan.displayCommand)}`,\n  ]);\n  await markUpdateNotificationShown(info.latestVersion);\n  log.blank();\n}\n\nasync function upgradeCommand(options: UpgradeOptions): Promise<void> {\n  trackEvent(\"command\", { name: \"upgrade\" });\n\n  const info = await checkForUpdates({ force: true });\n  const plan = info?.upgradePlan ?? getUpgradePlan();\n\n  if (!info) {\n    log.warn(\"Couldn't check for updates right now.\");\n    log.info(`Try again later or run ${pc.cyan(plan.displayCommand)} manually.`);\n    return;\n  }\n\n  if (!info.updateAvailable) {\n    log.success(`ctx7 is up to date (${pc.bold(`v${VERSION}`)})`);\n    return;\n  }\n\n  log.blank();\n  log.info(\n    `Update available: ${pc.bold(`v${info.currentVersion}`)} ${pc.dim(\"->\")} ${pc.bold(`v${info.latestVersion}`)}`\n  );\n\n  if (plan.needsExplicitVersion) {\n    log.info(`You're using an ephemeral runner (${plan.installMethod}).`);\n    log.info(`Use ${pc.cyan(plan.displayCommand)} to run the latest version immediately.`);\n    log.info(`Or install globally with ${pc.cyan(\"npm install -g ctx7@latest\")}.`);","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/upstash/context7/blob/5284672feb575908efead6fcf1b5e542f8d607bb/packages/cli/src/commands/upgrade.ts#L112-L148","documentation":"Warned by `ctx7 upgrade` when checkForUpdates({ force: true }) resolved to null — the update check against the npm registry could not be completed (network error, DNS failure, proxy block, or registry 5xx, all swallowed into a null). The CLI prints a retry hint plus the manual upgrade command from the resolved upgrade plan (e.g. the install command for your package manager) and exits without upgrading.","triggerScenarios":"`ctx7 upgrade` while offline; behind a corporate proxy that blocks registry.npmjs.org; DNS misconfiguration; npm registry outage/rate-limiting; HTTP(S)_PROXY env vars pointing at a dead proxy.","commonSituations":"Laptops on restrictive networks right after switching Wi-Fi; CI runners with no outbound npm access; misconfigured proxy env vars lingering in the shell; air-gapped environments.","solutions":["Check connectivity to the registry: `npm ping` or `curl -I https://registry.npmjs.org`","Fix or unset proxy env vars (HTTP_PROXY/HTTPS_PROXY) and re-run `ctx7 upgrade`","Run the manual command the CLI printed, e.g. `npm install -g @upstash/context7@latest`","If the registry is down, simply retry later"],"exampleFix":"# before\n$ ctx7 upgrade\nCouldn't check for updates right now.\nTry again later or run npm install -g @upstash/context7@latest manually.\n\n# after\n$ curl -I https://registry.npmjs.org   # verify reachable\n$ ctx7 upgrade","handlingStrategy":"retry","validationCode":"// Verify registry reachability before running the upgrade flow\nasync function registryReachable(): Promise<boolean> {\n  try {\n    const res = await fetch(\"https://registry.npmjs.org/-/ping\", {\n      signal: AbortSignal.timeout(5000),\n    });\n    return res.ok;\n  } catch {\n    return false;\n  }\n}\nif (!(await registryReachable())) {\n  console.error(\"npm registry unreachable — fix network/proxy before ctx7 upgrade\");\n}","typeGuard":null,"tryCatchPattern":"async function checkForUpdatesSafe() {\n  for (let attempt = 0; attempt < 3; attempt++) {\n    const info = await checkForUpdates({ force: true });\n    if (info) return info; // null means the check failed — retry with backoff\n    await new Promise((r) => setTimeout(r, 2 ** attempt * 1000));\n  }\n  return null; // give up: surface the manual upgrade command\n}","preventionTips":["Wrap checkForUpdates() in a null check and retry with exponential backoff — null is its failure signal","Keep HTTP(S)_PROXY correct in CI/shell profiles before upgrade commands","Cache the manual upgrade command (plan.displayCommand) so users can self-serve when the check fails"],"tags":["network","upgrade","npm-registry","cli"],"backgroundTag":"update-check-failed","analyzedSha":"5284672feb575908efead6fcf1b5e542f8d607bb","analyzedAt":"2026-08-18T18:00:18.510Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}