Search code examples
npmnpm-publish

Is there a way to change the latest version of a package on npm


So for example, I made a package and published it with version 1.0.0.

But then, I decided that I want to change the version of my package to 0.1.0and add a default tag latest.

How can I do that?


Solution

  • In the package.json, you need to update the version and then publish the package by using the attribute --tag=latest. So the syntaxt will become: npm publish --tag=latest.