npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Is it possible to publish the same version?

I’ve publish first version and make one mistake, I’ve found that I can unpublish version I’ve just published.

then I’ve try to publish again the same version got error that I need to wait 24 hours.

After 24 hours I’ve try to publish the same version again but got error that I can’t publish the same version.

Is this supported? why there is unpublish If I can republish?


It’s not possible to republish an unpublished version (source, emphasis mine):

Even if a package version is unpublished, that specific name and version combination can never be reused. In order to publish the package again, a new version number must be used. Additionally, new versions of packages with every version unpublished may not be republished until 24 hours have passed.

IIRC, this is to prevent malicious packages. If it’s possible to republish any given version, malicious code could be installed without ever updating the package.