【问题标题】:yarn add installs multiple versions, [how to] ensure that there is only one installed?yarn add 安装多个版本,【如何】保证只安装一个?
【发布时间】:2022-09-23 04:36:24
【问题描述】:

我正在尝试运行this tutorial,并且收到大量有关冲突包的警告(请参见下文)。当我运行yarn dedupe 时,我收到一条令人沮丧的消息error The dedupe command isn\'t necessary. yarn install will already dedupe. 首先yard install 已被yarn add 替换,其次,如果纱线自动重复数据删除,我怎么会有这么多重复的包?有人可以告诉这个新手如何修复这些重复的包吗?我是否必须手动逐个文件夹并删除它们?

@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

    标签: yarnpkg polkadot


    【解决方案1】:

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

    将您的 polkadot 分辨率设置为与 polkadot apps 相同的值,您应该一切顺利。这是他们目前设置的:

    注意:我还必须更改我的依赖项以匹配这些版本,但控制台现在更干净了。

    【讨论】:

      猜你喜欢
      • 2020-05-08
      • 1970-01-01
      • 1970-01-01
      • 2015-03-31
      • 2020-07-11
      • 2022-08-18
      • 1970-01-01
      • 1970-01-01
      • 2023-01-19
      相关资源
      最近更新 更多