# Errors

> The common bump errors, what causes each one, and how to fix it, with the exact message text.

When bump stops, it prints a `FAIL` block on stderr and exits with `1`, or with `130` or `143` after a signal. Most checks run before bump writes a file, so the repository stays as it was. When a step of the release itself fails, bump undoes it. See [Undo](#undo).

The errors for config keys are in [Config](/config/#validation). The errors for arguments and options are in CLI: [Type or version](/cli/#type-or-version), [Parsing rules](/cli/#parsing-rules), and [Conflicts](/cli/#conflicts).

## No tag found

```console
$ bump minor
FAIL No tag found for 2 units whose manifests are past 0.0.0
│
│      @acme/core   manifest 1.2.0   expected tag @acme/core@1.2.0
│      app          manifest 3.4.0   expected tag app@3.4.0
│
│    To continue from the last release, tag the commit that released it:
│      git tag -a @acme/core@1.2.0 -m @acme/core@1.2.0 <commit>
│      git tag -a app@3.4.0 -m app@3.4.0 <commit>
│
│    To use the manifest versions as the base, run again with --adopt:
│      bump minor --adopt   →   @acme/core 1.3.0, @acme/cli 0.4.2, app 3.5.0
```

**Cause:** a unit has a version past `0.0.0` in its manifest, but no tag for that version. bump needs the tag to find the changes since the last release. This is common when you start to use bump in an existing repository, or after you change `tag` in the config.

The error lists every unit with no tag. In lockstep mode, the unit name is `(lockstep)`.

**Fix:** choose one:

- Tag the commit that released each version, with the commands that the error prints. Put the SHA of that commit in place of `<commit>`. bump then finds the changes since that commit.
- Run again with `--adopt`. bump uses the manifest versions as the base, and releases each unit with no tag as changed. The last line of the error shows the command and the versions that it gives.

```console
$ bump minor --adopt --dryrun
BUMP @acme/core 1.2.0 → 1.3.0  (adopted)
BUMP @acme/cli 0.4.1 → 0.4.2  (dependent)
BUMP app 3.4.0 → 3.5.0  (adopted)
EDIT app devDependencies["@acme/core"] ^1.2.0 → ^1.3.0
EDIT @acme/cli dependencies["@acme/core"] ^1.2.0 → ^1.3.0
DONE Dry run; no files were written
```

A unit at `0.0.0` with no tag is a first release, not an error. With targets, bump checks only the targets and the units that depend on them, so an unrelated unit with no tag does not stop `bump patch @acme/cli`. See [Anchors](/how-it-works/#anchors).

## Released past the manifest

```console
$ bump patch
FAIL "v1.3.0" is released, but the manifest says 1.2.0
```

**Cause:** a tag in the history of HEAD has a version greater than the manifest. The manifest and the tags disagree. For example, someone made the tag by hand, or reverted the release commit but kept its tag.

**Fix:** find out which one is correct. If the release happened, set the manifest to that version and commit. If it did not, delete the tag with `git tag -d v1.3.0`, and from the remote too if you pushed it.

## Anchor not in history

```console
$ bump patch
FAIL The "v1.2.0" release commit is not in the history of HEAD; merge it first
```

**Cause:** the tag of the manifest version exists, but its commit is not in the history of HEAD. Often, the release happened on another branch.

**Fix:** merge the branch with the release commit into your branch, then run bump again.

## Shallow clone

```console
$ bump patch
FAIL A full clone is needed: the history and tags are used to find changes (in CI, fetch all history and tags)
```

**Cause:** the repository is a shallow clone. bump needs the full history and all tags.

**Fix:** fetch all history and tags. See [Full clone](/ci/#full-clone).

## No commits

```console
$ bump patch
FAIL The repository has no commits
```

**Cause:** HEAD has no commit. bump reads only committed files.

**Fix:** commit your files, then run bump.

A directory that is not in a git repository gives another error:

```console
$ bump patch
FAIL Not a git repository: "/private/tmp"
```

## Dirty tree

```console
$ bump patch
FAIL Commit or stash the changes to tracked files first:
│    notes.md
│    packages/core/index.js
```

**Cause:** tracked files have changes that are not committed. The list includes staged files. bump commits only its own edits, and it does not mix them with yours.

**Fix:** commit or stash the listed files. Untracked files do not count.

A dry run does not stop. It prints the list as a warning, then the release:

```console
$ bump patch --dryrun
WARN A release needs a clean tree; these tracked files have changes:
│    notes.md
│    packages/core/index.js
BUMP @acme/core 1.3.0 → 1.3.1  (changed)
BUMP @acme/cli 0.4.2 → 0.4.3  (dependent)
EDIT app devDependencies["@acme/core"] ^1.3.0 → ^1.3.1
EDIT @acme/cli dependencies["@acme/core"] ^1.3.0 → ^1.3.1
DONE Dry run; no files were written
```

## Merge in progress

```console
$ bump patch
FAIL A bisect is in progress; finish it first
```

**Cause:** a merge, rebase, cherry-pick, revert, or bisect is in progress. The message names it. A merge with conflicts, or with changes that are not committed, gives the [dirty tree](#dirty-tree) error first.

**Fix:** finish it or abort it, for example with `git bisect reset`, `git merge --continue`, or `git merge --abort`.

## Untracked files

```console
$ bump minor
FAIL These files are not tracked by git: "packages/web/package.json"
```

**Cause:** bump must edit a file that git does not track. Here, a new package is not committed yet.

**Fix:** commit the file, then run bump again.

An untracked `Cargo.lock` does not cause this error. bump does not write it. See [Lockfiles](/lockfiles/#cargolock).

## Existing tags

```console
$ bump minor
FAIL These tags already exist: "@acme/web@0.1.0"
```

**Cause:** a new tag of this release already exists, but not in the history of HEAD. For example, an experiment on another branch made it.

**Fix:** if the tag is a mistake, delete it with `git tag -d @acme/web@0.1.0`. Else, release another version: give a higher type or an exact version.

## Invalid tag name

```console
$ bump minor
FAIL Invalid tag name: "@acme/core:0.1.0"
```

**Cause:** the [`tag`](/config/#tag) template gives a name that git does not accept as a tag. For example, git does not allow a space, `:`, `~`, `^`, `?`, `*`, `[`, or `..` in a tag name.

**Fix:** change `tag` in the config, for example to `{name}@{version}`.

## Mixed versions

```console
$ bump minor
FAIL All packages must share one version in lockstep mode:
│    @acme/cli  0.9.0
│    @acme/core  1.2.0
```

**Cause:** all members of a unit must have the same version in their manifests. In lockstep mode, the unit is all versioned packages, and the message names no unit. In a group, it names the group:

```console
$ bump minor
FAIL The members of "acme" must share one version:
│    @acme/core  1.2.0
│    @acme/cli  0.9.0
```

**Fix:** set one version in each listed manifest and commit. If the version has no tag, see [No tag found](#no-tag-found). If the packages need their own versions, use [independent mode](/modes/#independent), or take the package out of the group.

## Shared Cargo versions

```console
$ bump minor
FAIL Crates "acme-cli", "acme-core" share [workspace.package] version; name them in "groups", e.g. "groups": { "<name>": ["acme-cli"] }
```

**Cause:** in independent mode, crates with `version.workspace = true` share one version, so they must be one unit. bump cannot choose a name for that unit.

**Fix:** add a group that lists one of the crates. The other crates join it:

```jsonc [bump.json]
{
  "independent": true,
  "groups": {
    "acme": ["acme-core"]
  }
}
```

The group tag is then `acme@<version>`, so the group needs that tag. See [No tag found](#no-tag-found). With the tag `acme@1.2.0` in place, and a change in `acme-core`:

```console
$ bump minor --dryrun
BUMP acme 1.2.0 → 1.3.0  (changed)
     acme-core, acme-cli
DONE Dry run; no files were written
```

A root `Cargo.toml` with a `[package]` that inherits the version names the group too, with no config. See [Cargo](/cargo/).

## Must be greater

```console
$ bump prerelease --preid beta
FAIL The next version must be greater than 1.3.0-next.2, but is 1.3.0-beta.0
```

**Cause:** each new version must be greater than the current one. A preid that sorts lower gives a lower version: `beta` sorts before `next`. An exact version that is not higher gives the same error:

```console
$ bump 1.2.0
FAIL The next version must be greater than 1.3.0-next.2, but is 1.2.0
```

**Fix:** use a preid that sorts higher, such as `rc`, or a higher exact version. In independent mode, the message names the unit.

## Cannot continue a prerelease

```console
$ bump prerelease
FAIL Cannot continue the "1.3.0-0" prerelease; use an exact version
```

**Cause:** bump continues only a prerelease of the form `1.3.0-next.2` or `1.3.0-next`. It cannot continue other forms, such as `1.3.0-0` or `1.3.0-a.b.c`.

**Fix:** give an exact version. After it, `prerelease` works again:

```console
$ bump 1.3.0-rc.0 --dryrun
BUMP 1.3.0-0 → 1.3.0-rc.0  (changed)
DONE Dry run; no files were written
```

When the unit is a dependent, release it as a target first:

```console
$ bump patch
FAIL Cannot continue the "0.5.0-0" prerelease of "@acme/cli"; release it as a target with an exact version first
```

For example, `bump 0.5.0-next.0 @acme/cli`. See [Prereleases](/prereleases/).

## Unknown targets

```console
$ bump patch nope @acme/nil
FAIL Unknown targets: "nope", "@acme/nil"
```

**Cause:** a target is not a package name or a group name. The error lists all unknown targets.

**Fix:** check the names. A target is the `name` of a manifest, not a directory.

A package without a version cannot be a target:

```console
$ bump patch @acme/ui
FAIL Package "@acme/ui" has no version, so it cannot be a target
```

## Missing package manager

```console
$ bump minor
FAIL Missing "yarn" binary to update "/private/tmp/acme/yarn.lock"
```

**Cause:** git tracks an npm lockfile, but its package manager is not on your `PATH`. bump checks this before it writes a file, also in a dry run.

**Fix:** install the package manager, or stop to track the lockfile if you do not use it. See [Lockfiles](/lockfiles/#package-managers).

## Packages

These errors come from the manifests:

| Error | Cause |
| --- | --- |
| `No packages found` | No glob of `packages`, and no workspace file, matches a directory with a manifest. See [`packages`](/config/#packages). |
| `No versioned packages found` | No package has a version. |
| `Invalid version "1.2" in "<file>"` | A version is not a full semver version. |
| `Two packages are named "@acme/ui": "<file>" and "<file>"` | Two manifests have the same name. |

A manifest without a name is not an error. bump skips it with a warning. Here `packages/core/package.json` has no `name`, and the only other package, `@acme/docs`, has no version:

```console
$ bump patch --dryrun
WARN Missing "name" field in "/private/tmp/acme/packages/core/package.json"
FAIL No versioned packages found
```

## Undo

When a step of the release fails, bump undoes the release. See [Undo](/how-it-works/#undo). The message names the step and the cause:

| Message | Cause |
| --- | --- |
| `Could not commit: <output>` | A git hook, such as `pre-commit`, failed, or git has no identity. |
| `Could not create tag "v1.2.1": <output>` | git could not make the tag. Often, tag signing failed. |
| `Could not update "package-lock.json": <output>` | The lockfile command failed. See [Lockfiles](/lockfiles/#failures). |
| `Stopped by SIGINT`, `Stopped by SIGTERM` | A signal stopped the release. The exit code is `130` or `143`. |

`<output>` is the first `error:` or `fatal:` line of the output of git or of the tool, without that prefix. Without such a line, it is the first line.

```console
$ bump patch
BUMP 1.2.0 → 1.2.1  (changed)
FAIL Could not create tag "v1.2.1": gpg failed to sign the data
│    The release was undone: no files, commits, or tags changed.
```

Fix the cause, then run bump again. Hooks run as usual, and bump has no option to skip them.

If the undo itself fails, the message says `The undo failed too:`. See [Undo](/how-it-works/#undo).
