package version delete

Delete a package version.

Specify the ID or alias of the package version you want to delete. In second-generation managed packaging, only beta package versions can be deleted. Before deleting a package version, review the considerations outlined in https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_package_deletion.htm.

force:package:version:delete

Flag Name (Long)Flag Name (Short)Description
‑‑api‑versionN/AType: Value

Override the api version used for api requests made by this command
‑‑flags‑dirN/AType: Value

Import flag values from a directory.
‑‑jsonN/AType: Boolean

Format output as json.
‑‑no‑prompt‑nType: Boolean

Don’t prompt before deleting the package version.
‑‑package‑pType: Value
Required

ID (starts with 04t) or alias of the package version to delete.
‑‑target‑dev‑hub‑vType: Value
Required

Username or alias of the Dev Hub org. Not required if the target-dev-hub configuration variable is already set.

Delete a package version with the specified alias using your default Dev Hub org:

Delete a package version with the specified ID using the Dev Hub org with username “devhub@example.com”: