1

i am clone substrate node template from this command "git clone --branch latest --depth 1 https://github.com/substrate-developer-hub/substrate-node-template"

add pallet_democracy in runtime/cargo.toml

then run below command "cargo check -p node-template-runtime"

i will get below error error: failed to select a version for syn. ... required by package frame-support-procedural v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.26#e8a7d161) ... which satisfies git dependency frame-support-procedural of package frame-support v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.26#e8a7d161) ... which satisfies git dependency frame-support of package frame-benchmarking v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.26#e8a7d161) ... which satisfies git dependency frame-benchmarking of package pallet-democracy v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.26#e8a7d161) ... which satisfies git dependency pallet-democracy of package node-template-runtime v4.0.0-dev (/home/amit/Substrate/New/substrate-node-template/runtime) ... which satisfies path dependency node-template-runtime (locked to 4.0.0-dev) of package node-template v4.0.0-dev (/home/amit/Substrate/New/substrate-node-template/node) versions that meet the requirements ^1.0.98 are: 1.0.98

all possible versions conflict with previously selected packages.

previously selected package syn v1.0.95 ... which satisfies dependency syn = "^1.0.84" (locked to 1.0.95) of package async-trait v0.1.53 ... which satisfies dependency async-trait = "^0.1" (locked to 0.1.53) of package jsonrpsee-core v0.13.1 ... which satisfies dependency jsonrpsee-core = "^0.13.1" (locked to 0.13.1) of package jsonrpsee v0.13.1 ... which satisfies dependency jsonrpsee = "^0.13.0" (locked to 0.13.1) of package node-template v4.0.0-dev (/home/amit/Substrate/New/substrate-node-template/node)

failed to select a version for syn which could resolve this conflict

How to solve it!!

2

4 Answers 4

2

Usually this happens when you have some dependency version conflicts in your runtime Cargo.toml and pallet's Cargo.toml.

Compare all of the Cargo.toml in your project and compare all the versions of each dependencies in every place. it should be similar.

for example,

in runtime if you're using this frame-election-provider-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.24" }

and in your pallet if you are using different branch like this frame-election-provider-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate.git", branch = "polkadot-v0.9.18" }

you will get this error. hope this helps

1

Try the process described in the tutorials here: https://docs.substrate.io/tutorials/work-with-pallets/add-a-pallet/

1
  • I am following above link but after adding pallet-democracy in the runtime i get above error
    – Mr_Amit
    Jul 18, 2022 at 16:55
0

i am follow above tutorial and add pallet-democracy in the runtime/cargo.toml then run below command "cargo check -p node-template-runtime"

but i will get below error

error: failed to select a version for syn. ... required by package frame-support-procedural v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.26#e8a7d161) ... which satisfies git dependency frame-support-procedural of package frame-support v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.26#e8a7d161) ... which satisfies git dependency frame-support of package frame-benchmarking v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.26#e8a7d161) ... which satisfies git dependency frame-benchmarking of package pallet-democracy v4.0.0-dev (https://github.com/paritytech/substrate.git?branch=polkadot-v0.9.26#e8a7d161) ... which satisfies git dependency pallet-democracy of package node-template-runtime v4.0.0-dev (/home/amit/Substrate/New/substrate-node-template/runtime) ... which satisfies path dependency node-template-runtime (locked to 4.0.0-dev) of package node-template v4.0.0-dev (/home/amit/Substrate/New/substrate-node-template/node) versions that meet the requirements ^1.0.98 are: 1.0.98

all possible versions conflict with previously selected packages.

previously selected package syn v1.0.95 ... which satisfies dependency syn = "^1.0.84" (locked to 1.0.95) of package async-trait v0.1.53 ... which satisfies dependency async-trait = "^0.1" (locked to 0.1.53) of package jsonrpsee-core v0.13.1 ... which satisfies dependency jsonrpsee-core = "^0.13.1" (locked to 0.13.1) of package jsonrpsee v0.13.1 ... which satisfies dependency jsonrpsee = "^0.13.0" (locked to 0.13.1) of package node-template v4.0.0-dev (/home/amit/Substrate/New/substrate-node-template/node)

failed to select a version for syn which could resolve this conflict

1
  • As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
    – Iker
    Jul 19, 2022 at 10:20
-1

Go to Cargo.lock -> search name = "syn" -> remove checksum -> set version = "1.0.96" (with branch ="polkadot-v0.9.24) -> cargo build --release

With another branch, you should choose "syn" version properly

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.