{"record":{"id":"6fff46e7fa1c0534","repo":"windmill-labs/windmill","slug":"cannot-fetch-latest-cli-version-on-npmjs-to-check","errorCode":null,"errorMessage":"Cannot fetch latest CLI version on npmjs to check if up-to-date: ${e}","messagePattern":"Cannot fetch latest CLI version on npmjs to check if up-to-date: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"cli/src/main.ts","lineNumber":238,"sourceCode":"  .command(\"datatable\", datatable)\n  .command(\"pipeline\", pipeline)\n  .command(\"ducklake\", ducklake)\n  .command(\"object-storage\", objectStorage)\n  .command(\"version --version\", \"Show version information\")\n  .action(async (opts: any) => {\n    console.log(\"CLI version: \" + VERSION);\n    try {\n      const provider = new NpmProvider({ package: \"windmill-cli\" });\n      const versions = await provider.getVersions(\"windmill-cli\");\n      if (versions.latest !== VERSION) {\n        console.log(\n          `CLI is outdated. Latest version ${versions.latest} is available. Run \\`wmill upgrade\\` to update.`\n        );\n      } else {\n        console.log(\"CLI is up to date\");\n      }\n    } catch (e) {\n      console.warn(\n        `Cannot fetch latest CLI version on npmjs to check if up-to-date: ${e}`\n      );\n    }\n    const workspace = await getActiveWorkspace(opts as GlobalOptions);\n    if (workspace) {\n      try {\n        const backendVersion = await fetchVersion(workspace.remote);\n        console.log(\"Backend Version: \" + backendVersion);\n      } catch (e) {\n        console.warn(\n          `Cannot fetch backend version from ${workspace.remote} (workspace: ${workspace.name}): ${e}`\n        );\n      }\n    } else {\n      console.warn(\n        \"Cannot fetch backend version: no active workspace selected, choose one to pick a remote to fetch version of\"\n      );\n    }","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/main.ts#L220-L256","documentation":"checkVersionSafe compares the installed CLI version against the latest wmill version on npmjs. When the npmjs fetch throws (network failure, DNS, proxy, rate limit), the catch prints this console.warn with the underlying error and the command continues normally — only the up-to-date/outdated notice is lost.","triggerScenarios":"Any command that triggers the npm version check (e.g. `wmill sync`, most commands) when the request to registry.npmjs.org fails: no internet, blocked egress, proxy misconfig, npm outage, or invalid WINDMILL-version-check environment overrides.","commonSituations":"CI runners without npmjs access; offline development; corporate firewalls; npmjs returning 429/5xx; IPv6 breakage on the host.","solutions":["Restore network access to registry.npmjs.org or configure HTTPS_PROXY/HTTP_PROXY.","Skip the check intentionally via the CLI's no-version-check env option (e.g. WMILL/no version check env var) in offline environments.","Check npm status (npmjs status page) if the error mentions HTTP 5xx.","Ignore the warning; it does not affect command execution."],"exampleFix":"// before\nwmill sync push\n// Cannot fetch latest CLI version on npmjs to check if up-to-date: TypeError: fetch failed\n\n// after\nexport HTTPS_PROXY=http://proxy.corp.internal:3128\nwmill sync push","handlingStrategy":"try-catch","validationCode":"try {\n  const res = await fetch(\"https://registry.npmjs.org/wmill/latest\", { signal: AbortSignal.timeout(3000) });\n  console.log(\"npm reachable:\", res.ok);\n} catch (e) {\n  console.log(\"npm unreachable, up-to-date check will be skipped:\", e);\n}","typeGuard":null,"tryCatchPattern":"try {\n  await $`wmill sync push`;\n} catch (e) {\n  if (!String(e).includes(\"Cannot fetch latest CLI version\")) throw e;\n  // ignore version-check noise; the sync itself succeeded\n}","preventionTips":["Ensure egress to registry.npmjs.org or set HTTPS_PROXY/HTTP_PROXY","Disable the version check explicitly in offline environments rather than letting it fail","Pin wmill versions in CI so the up-to-date notice is irrelevant","Watch for 429/5xx from npm during outages"],"tags":["cli","network","npm","version-check"],"backgroundTag":"network-request-failed","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}