1 npm-version(1) -- Bump a package version
2 ========================================
6 npm version [<newversion> | major | minor | patch | build]
10 Run this in a package directory to bump the version and write the new
11 data back to the package.json file.
13 The `newversion` argument should be a valid semver string, *or* a valid
14 second argument to semver.inc (one of "build", "patch", "minor", or
15 "major"). In the second case, the existing version will be incremented
16 by 1 in the specified field.
18 If run in a git repo, it will also create a version commit and tag, and
19 fail if the repo is not clean.
21 If supplied with `--message` (shorthand: `-m`) config option, npm will
22 use it as a commit message when creating a version commit. If the
23 `message` config contains `%s` then that will be replaced with the
24 resulting version number. For example:
26 npm version patch -m "Upgrade to %s for reasons"
28 If the `sign-git-tag` config is set, then the tag will be signed using
29 the `-s` flag to git. Note that you must have a default GPG key set up
30 in your git config for this to work properly. For example:
32 $ npm config set sign-git-tag true
35 You need a passphrase to unlock the secret key for
36 user: "isaacs (http://blog.izs.me/) <i@izs.me>"
37 2048-bit RSA key, ID 6C481CF6, created 2010-08-31