Unpublishing packages from the registry

How to unpublish

As a package owner or collaborator, if your package has no dependents, you can permanently remove it from the npm registry by using the CLI. You can unpublish within 72 hours of the initial publish. Beyond 72 hours,so you can still unpublish your package if it meets certain criteria.

Note: Removing all the collaborators or teams from the package will not unpublish it.

Unpublishing a single version of a package

To unpublish a single version of a package, run the following command, replacing <package-name> with the name of your package, and <version> with your version number:

npm unpublish <package-name>@<version>

Unpublishing an entire package

To unpublish an entire package, run the following command, replacing <package-name> with the name of your package:

npm unpublish <package-name> -f

If you have two-factor authentication enabled for writes, you will need to add a one-time password to the unpublish command, --otp=123456 (where 123456 is the code from your authenticator app).

If you need help unpublishing your package, please contact npm Support. If you are an Enterprise customer, please contact npm Enterprise Support at [email protected].

When to unpublish

Unpublishing a package permanently removes the package from the registry so it is no longer available for other users to install. Once a package is unpublished, it cannot be republished. If you’ve unpublished a package by mistake, we’d recommend publishing again under a different name, or for unpublished versions, bumping the version number and publishing again.

You might want to unpublish a package because you:

Note: [email protected] is unique, and cannot be reused by unpublishing and re-publishing it. We recommend publishing a minor version update instead.

When to deprecate

If you are no longer interested in maintaining a package, but want it to remain available for users to install, or if your package has dependents, we’d recommend deprecating it. To learn about how to deprecate a package, see “Deprecating and undeprecating packages or package versions”.