9

I get this error when updating my package.

"cannot be republished until 24 hours have passed" in nodejs

2 Answers2

13

Your package was most likely unpublished with npm-unpublish. If it is so, you can publish your package again only after 24 hours.

Anton Novik
  • 1,768
  • 1
  • 19
  • 31
5

This will happen after you unpublished all versions with npm-unpublish. e.g.:

npm unpublish <package-name> -f

Sadly they do not warn you even if you just removed the last version e.g.:

npm unpublish <package-name>@<version>

after 24 hours it should work anyway.

I created a change request to give a warning about that.

Xanlantos
  • 887
  • 9
  • 18
  • as of version 8.3.1 a pull request to fix this with a warning has been accepted, see: https://github.com/npm/cli/pull/4191 – Xanlantos Feb 25 '22 at 09:09