Mistakenly tagged a version as latest on npm? Here’s how to fix it with dist-tags:
-
Tag the Version as
alpha: Assign thealphatag to the mistaken version. For example, if your package ismy-packageand version1.0.1was incorrectly tagged:npm dist-tag add my-package@1.0.1 alpha -
Update
latestto the Stable Version: Pointlatestto the correct stable version, like1.0.0:npm dist-tag add my-package@1.0.0 latest -
Verify the Tags: Check the updated tags for
my-package:npm dist-tag ls my-packageOutput might look like:
alpha: 1.0.1 latest: 1.0.0
Keep your package versions clear and user-friendly with these simple steps!