相关疑难解决方法(0)

无法使用 cargo uninstall 卸载 ~/.cargo 中的包:包 id 规范匹配没有包

我在从系统中卸载 Cargo 安装的软件包时遇到问题。

有明显安装在 rand-0.3.22 下的包 $HOME/.cargo

ls ~/.cargo/registry/src/github.com-1ecc6299db9ec823/ra

racer-2.0.14/     rand-0.3.22/      rand-0.4.2/
rand-0.4.3/       rand-0.5.5/       rand_core-0.2.1/
rawpointer-0.1.0/ rayon-1.0.2/      rayon-core-1.4.1/
Run Code Online (Sandbox Code Playgroud)

这也可以通过使用来验证 cargo pkgid

cargo pkgid -p rand

error: There are multiple `rand` packages in your project, and the specification `rand` is ambiguous.

Please re-run this command with `-p <spec>` where `<spec>` is one of the following:

rand:0.5.5
rand:0.4.3
rand:0.3.22
Run Code Online (Sandbox Code Playgroud)

但是,我无法使用cargo uninstall. 这些似乎都不起作用:

  • cargo uninstall rand

  • cargo uninstall -- rand:0.4.3

  • cargo uninstall https://github.com/rust-lang/crates.io-index#rand:0.4.3

对于上面的任何命令,我得到:

error: invalid package id specification: <name-of-package-i-specified>
Run Code Online (Sandbox Code Playgroud)

这似乎是一个相当基本的操作,所以我怀疑它是如何 …

rust rust-cargo

3
推荐指数
1
解决办法
2575
查看次数

标签 统计

rust ×1

rust-cargo ×1