badges/shields · warning · InvalidParameter

no versions found

Error message

no versions found

What it means

The winget base service throws InvalidParameter 'no versions found' when the package's manifest directory exists but none of its subdirectories are version trees containing a <name>.yaml manifest, so latest() returns null. This is an edge case: the package entry exists but is effectively empty.

Source

Thrown at services/winget/winget-base.js:123

    })
  }

  // Returns the latest version string for a package, or throws if not found.
  async getLatestVersion({ name }) {
    const json = await this.fetchVersions({ name })
    if (json.data.repository.object?.entries == null) {
      throw new InvalidParameter({ prettyMessage: 'package not found' })
    }
    const entries = json.data.repository.object.entries
    const directories = entries.filter(entry => entry.type === 'tree')
    const versionDirs = directories.filter(dir =>
      dir.object.entries.some(
        file => file.type === 'blob' && file.name === `${name}.yaml`,
      ),
    )
    const version = latest(versionDirs.map(dir => dir.name))
    if (version == null) {
      throw new InvalidParameter({ prettyMessage: 'no versions found' })
    }
    return version
  }
}

View on GitHub (pinned to 766fd8bc89)

Solutions

  1. Re-run later; if the package is mid-migration the directories may repopulate
  2. Check the winget-pkgs repo for the package's current directory structure
  3. If the package was restructured under a new id, use the new id instead
  4. File or check an issue on microsoft/winget-pkgs if the state persists
Defensive patterns

Strategy: retry

Type guard

function hasVersionDirs(entries, name) {
  return entries?.some(e => e.type === 'tree' &&
    e.object.entries.some(f => f.type === 'blob' && f.name === `${name}.yaml`))
}

Try / catch

try {
  const version = await service.getLatestVersion({ name })
} catch (e) {
  if (e.message === 'no versions found') {
    // retry after a delay or render 'no versions' badge
  } else throw e
}

Prevention

When it happens

Trigger: The winget-pkgs directory for the package contains only non-tree entries or version dirs without the matching manifest blob, e.g. during repackaging or after manifests were moved to a new schema.

Common situations: Packages migrated to the new winget manifest format (yaml moved/renamed), deprecated packages with pruned directories, transient states while a package is being republished.

Related errors


AI-assisted analysis of badges/shields@766fd8bc89 (2026-08-30). Data as JSON: /api/errors/60570ffd95967f5d. Report an issue: GitHub.