oclif / oclif/plugin-update

Cannot update from a version like 1.2.10 to 1.2.1, "already on version"

Open Beginner friendly
#1,390 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stale
Dominant language
TypeScript
Stars
56
Forks
34
Avg merge
27m
Merged PRs (30d)
2

Description

Describe the bug
When on a version like 1.2.10, cannot update to 1.2.1.

To Reproduce
Steps to reproduce the behavior:

  1. Have an CLI version like 1.2.10-gitsha installed
  2. Run the command update --version 1.2.1
  3. An error results: <cli name>: Updating CLI... already on version 1.2.10-gitsha

Expected behavior
Update runs to version 1.2.1

Screenshots
<cli name>: Updating CLI... already on version <current version>

Environment (please complete the following information):

  • OS & version: macOS 26.6.1
  • Shell/terminal & version zsh 5.9 (arm64-apple-darwin25.0)

Additional context
I think this is due to all the .startsWith(version) happening in the implementation, so maybe this could affect all stringwise prefixes, including prerelease or other channel versions like 1.2.0-alpha to 1.2.0?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the problem with a CLI at 1.2.10-gitsha and update --version 1.2.1. Locate the update-version handling and the .startsWith(version) checks mentioned in the issue, then inspect nearby tests or add coverage for the reported versions and prerelease cases. Done means the command updates to 1.2.1 instead of reporting that it is already current.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.