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.
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>
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
--otp=123456 (where 123456 is the code from your authenticator app).
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:
[email protected]is unique, and cannot be reused by unpublishing and re-publishing it. We recommend publishing a minor version update instead.
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”.