在 Parity Substrate 教程中打破依赖关系

问题描述

目前在完成 https://substrate.dev/docs/en/tutorials/add-a-pallet/import-a-pallet 时存在依赖性问题:

 cargo check -p node-template-runtime
    Updating git repository `https://github.com/paritytech/substrate.git`
    Updating crates.io index
error: Failed to select a version for `log`.
    ... required by package `pallet-balances 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/jontyn/sandBox/substrate/substrate-node-template/runtime)`
    ... which is depended on by `node-template v3.0.0 (/Users/jontyn/sandBox/substrate/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 `frame-support v3.0.0`
    ... which is depended on by `frame-benchmarking v3.0.0`
    ... which is depended on by `frame-benchmarking-cli v3.0.0`
    ... which is depended on by `node-template v3.0.0 (/Users/jontyn/sandBox/substrate/substrate-node-template/node)`

Failed to select a version for `log` which Could resolve this conflict

解决方法

您可以为这个有问题的特定软件包更新您的依赖项:https://doc.rust-lang.org/cargo/commands/cargo-update.html

cargo update -p log