When you make significant changes to a published package, we recommend updating the version number to communicate the extent of the changes to others who rely on your code.

Note: If you have linked a git repository to a package, updating the package version number will also add a tag with the updated release number to the linked git repository.

  1. To change the version number in package.json, on the command line, in the package root directory, run the following command, replacing <update_type> with one of the semantic versioning release types (patch, major, or minor):

    npm version <update_type>
  2. Run npm publish.

  3. Go to your package page (https://npmjs.com/package/<package>) to check that the package version has been updated.

For more information on npm version, see the CLI documentation.

Edit this page on GitHub
1 contributormona
Last edited by mona on March 21, 2023
声明:npm 及相关 logo 的版权归 npmjs.com 所有。本站点仅用于 npm 中文文档,与 npmjs.com 没有任何关系。由于译者水平有限,且避免产生误解,条款和政策内容不进行翻译,关于这部分,请移步官网查看最新内容。