微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

得到错误:没有找到包`codec` 的匹配版本`^2.0.0`?

如何解决得到错误:没有找到包`codec` 的匹配版本`^2.0.0`?

问题

我是 Substrate 的新手,正在学习将托盘添加到您的运行时。起初,运行命令 cargo check -p node-template-runtime 给了我错误

error: Failed to parse manifest at `/Users/bashar/work/substrate/start/substrate-node-template/pallets/template/Cargo.toml`

Caused by:
  feature `rename-dependency` is required

consider adding `cargo-features = ["rename-dependency"]` to the manifest

添加了它,然后我开始收到此错误

error: no matching version `^2.0.0` found for package `codec`                                                                                                                                                  
location searched: registry `https://github.com/rust-lang/crates.io-index`
versions found: 0.0.0
required by package `frame-benchmarking-cli v3.0.0`
    ... which is depended on by `node-template v3.0.0 (/Users/bashar/work/substrate/start/substrate-node-template/node)`

我尝试将编解码器版本修改2.0.1,但没有成功。我的设置

rustup 1.23.1
rustc 1.50.0
cargo 1.30.0

知道我做错了什么吗?

更新

我回到了 Create Your First Substrate Chain,它是本教程的基础,它是 Pallet 教程的基础,从头开始。而这一次,在为第一个教程克隆存储库后,cargo build --release 失败并出现相同的错误 feature rename-dependency is required

在我转到第二个教程之前,这第一次构建得很好。这让我觉得最近的 Mac 更新可能毁了一些东西?我什至尝试卸载 Rust 并重新安装它,然后安装一个新模板。一样的

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。