cargo-count icon indicating copy to clipboard operation
cargo-count copied to clipboard

unable to install

Open 0x8f701 opened this issue 4 years ago • 4 comments

    Updating git repository `https://github.com/kbknapp/cargo-count`
  Installing cargo-count v0.2.4 (https://github.com/kbknapp/cargo-count#eebe6f87)
    Updating crates.io index
error: failed to compile `cargo-count v0.2.4 (https://github.com/kbknapp/cargo-count#eebe6f87)`, intermediate artifacts can be found at `/tmp/cargo-installSJ1NfQ`

Caused by:
  failed to select a version for the requirement `clap = "~2.11.2"`
  candidate versions found which didn't match: 2.33.3, 2.33.2, 2.33.1, ...
  location searched: crates.io index
required by package `cargo-count v0.2.4 (/home/cheng/.cargo/git/checkouts/cargo-count-01e28dcffdb7943b/eebe6f8)`

0x8f701 avatar Sep 04 '20 17:09 0x8f701

Clap maintainer has yanked all the versions up to 2.21.0 which caused this error. The only option (except waiting for the cargo-count author to update dependency) I can see so far — build it manually and put binary to ~/.cargo/bin.

survived avatar Oct 01 '20 11:10 survived

Easy install cargo-count with fix #46:

git clone https://github.com/kbknapp/cargo-count.git
cd cargo-count
git fetch origin pull/46/head:pr-46
git checkout pr-46
cargo install --path ./
# ready!
cargo count --all --unsafe-statistics --exclude target

Fenex avatar Jan 11 '21 17:01 Fenex

cargo install --git https://github.com/slerpyyy/cargo-count --branch master works as a one liner.

richardwhiuk avatar Mar 24 '21 00:03 richardwhiuk

If you want to install from the original repo (rather than a forked one) with a yanked dependency, and assuming the repo has a Cargo.lock file (which it does in this case), you can use the --locked argument, as so:

cargo install --git https://github.com/kbknapp/cargo-count --branch master --locked

ekoutanov avatar Sep 21 '21 22:09 ekoutanov