Skip to content

Delete a single package version

Delete one version of a package, leaving the rest of the package and its other versions intact.

Warning: destructive, single-version blast radius

Section titled “Warning: destructive, single-version blast radius”

This is restorable only within GitHub’s roughly 30-day retention window, and only if nothing has since been republished under the same version — a republish in that window permanently forecloses the restore option for what you deleted. Past 30 days, or past a republish, there is no recovery path at all.

If you mean to remove the entire package (all versions), use delete-package instead.

  1. Confirm you have the right version: run get-package-version first and check the name and createdAt match the version you intend to remove.
  2. If you’re not fully sure which numeric versionId corresponds to which published version, run list-package-versions and cross-reference before proceeding — versionId is an opaque internal id, not the semver/tag string.
  1. Call the tool, passing the version id twice — once as versionId, once as confirmVersionId. Both must match exactly, or the tool refuses the call with a confirmation_mismatch error before making any API request:

    delete_package_version {
    org: "your-org",
    packageType: "npm",
    packageName: "your-package",
    versionId: 123456,
    confirmVersionId: 123456
    }
  2. On success you get back { org, packageType, packageName, versionId }. There is no dry-run mode — a successful call has already deleted the version.

Within the ~30-day window, and only if nothing has republished under the same version in the meantime, call restore-package-version with the same org, packageType, packageName, and versionId.