我正在学习基础知识和
我只是在学习一些教程。
在第二个教程(https://substrate.dev/docs/en/tutorials/add-a-pallet/import-a-pallet)中,由于下面的错误,我无法继续。
Execution failed (exit code 101).
/Users/~~~/.cargo/bin/cargo metadata --verbose --format-version 1 --all-features
stdout : Updating git repository `https://github.com/paritytech/substrate.git`
Updating crates.io index
error: failed to select a version for `log`.
... required by package `frame-support v3.0.0 (https://github.com/paritytech/substrate.git?tag=monthly-2021-05#70ef0afc)`
... which is depended on by `pallet-nicks v3.0.0 (https://github.com/paritytech/substrate.git?tag=monthly-2021-05#70ef0afc)`
... which is depended on by `node-template-runtime v3.0.0 (/Users/~~~/projects/substrate-node-template/runtime)`
... which is depended on by `node-template v3.0.0 (/Users/~~~/projects/substrate-node-template/node)`
versions that meet the requirements `^0.4.14` are: 0.4.14
all possible versions conflict with previously selected packages.
previously selected package `log v0.4.13`
... which is depended on by `finality-grandpa v0.13.0`
... which is depended on by `sc-finality-grandpa v0.9.0`
... which is depended on by `node-template v3.0.0 (/Users/~~~/projects/substrate-node-template/node)`
failed to select a version for `log` which could resolve this conflict
stderr : 当我在运行时/Cargo.toml上添加了关于教程内容的托盘-记号和特性时,就会发生这种情况。
在此之前,一切都很好。
发布于 2021-06-09 21:18:21
我找到了一个解决方法,就是在cargo.toml上手动添加日志依赖,如下所示
# cargo.toml
log = '^0.4.14'它是正常的,但是在下一步之后我遇到了另一个问题(它在配置后无法构建),所以我只使用了答案分支(add-a-pallet-v3.0.0+monthly-2021-05),它是正常的……
发布于 2021-06-16 18:37:52
我遇到了同样的错误。解决方法是:在您的cargo.toml中,不要添加:"pallet-nicks ={ default-features = false,version = '3.0.0',git = 'https://github.com/paritytech/substrate.git',tag = 'monthly-2021-05‘}“,只需添加"pallet-nicks ={ default-features = false,version = '3.0.0'}”即可。
https://stackoverflow.com/questions/67884930
复制相似问题