yarn add installs multiple versions, [how to] ensure that there is only one installed?

1k Views Asked by At

I am trying to run this tutorial and I am getting a slew of warnings about conflicting packages (please see below). When I run yarn dedupe I get a frustrating message error The dedupe command isn't necessary. yarn install will already dedupe. First of all yard install has been replaced with yarn add and second, if yarn is automatically deduping, how come I have so many duplicate packages? Can someone please tell this newbie how to fix these duplicate packages? Do I have to manually go folder by folder and delete them?

@polkadot/util has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\api-augment\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\rpc-augment\node_modules\@polkadot\util
@polkadot/util has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\api-augment\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\rpc-augment\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\types-augment\node_modules\@polkadot\util
@polkadot/util has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\api-augment\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\rpc-augment\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\types-augment\node_modules\@polkadot\util
        cjs 8.4.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-transactions\node_modules\@polkadot\util
@polkadot/util has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\api-augment\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\rpc-augment\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\types-augment\node_modules\@polkadot\util
        cjs 8.4.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-transactions\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@polkadot\util
@polkadot/util-crypto has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 8.4.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-transactions\node_modules\@polkadot\util-crypto
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@polkadot\util-crypto
@polkadot/wasm-crypto has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 4.6.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-transactions\node_modules\@polkadot\wasm-crypto
        cjs 5.1.1       D:\acala_hardhat\hello-world\node_modules\@polkadot\util-crypto\node_modules\@polkadot\wasm-crypto
@polkadot/util has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\api-augment\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\rpc-augment\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\types-augment\node_modules\@polkadot\util
        cjs 8.4.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-transactions\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@polkadot\util
        cjs 8.4.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\util
@polkadot/util-crypto has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 8.4.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-transactions\node_modules\@polkadot\util-crypto
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@polkadot\util-crypto
        cjs 8.4.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\util-crypto
@polkadot/wasm-crypto has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 4.6.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-transactions\node_modules\@polkadot\wasm-crypto
        cjs 5.1.1       D:\acala_hardhat\hello-world\node_modules\@polkadot\util-crypto\node_modules\@polkadot\wasm-crypto
        cjs 4.6.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\wasm-crypto
@polkadot/util has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\api-augment\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\rpc-augment\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\types-augment\node_modules\@polkadot\util
        cjs 8.4.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-transactions\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@polkadot\util
        cjs 8.4.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@polkadot\util
        cjs 8.7.1       D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@open-web3\orml-api-derive\node_modules\@polkadot\util
@polkadot/rpc-core has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 7.11.1      D:\acala_hardhat\hello-world\node_modules\@polkadot\api-derive\node_modules\@polkadot\rpc-core
        cjs 7.15.1      D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@open-web3\orml-api-derive\node_modules\@polkadot\rpc-core
@polkadot/types has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or dedupe using your package manager.
The following conflicting packages were found:
        cjs 7.11.1      D:\acala_hardhat\hello-world\node_modules\@polkadot\api-derive\node_modules\@polkadot\types
        cjs 7.15.1      D:\acala_hardhat\hello-world\node_modules\@acala-network\eth-providers\node_modules\@open-web3\orml-api-derive\node_modules\@polkadot\types
1

There are 1 best solutions below

0
On

See here: https://substrate.stackexchange.com/questions/2399/how-to-prevent-remove-duplicate-modules-and-mismatched-version-numbers-i-e

Set your polkadot resolutions to the same values as polkadot apps and you should be good to go. This is what they're currently set to:

Note: I also had to change my dependencies to match those versions, but the console is much cleaner now.