package.json 中的version可以手动修改,也可以通过npm命令管理
{ "version": "0.0.1" }
查看帮助
$ npm version -h npm version Bump a package version Usage: npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git] Options: [--allow-same-version] [--no-commit-hooks] [--no-git-tag-version] [--json] [--preid prerelease-id] [--sign-git-tag] [-w|--workspace <workspace-name> [-w|--workspace <workspace-name> ...]] [-ws|--workspaces] [--include-workspace-root] alias: verison Run "npm help version" for more info
使用示例
$ npm version major v1.0.0 $ npm version minor v1.1.0 $ npm version patch v1.1.1 $ npm version premajor v2.0.0-0 $ npm version prepatch v2.0.1-0 $ npm version prerelease v2.0.1-1
参考