paritytech / txwrapper

Helper funtions for offline transaction generation.
Apache License 2.0
58 stars 27 forks source link

When installed together with @polkadot/api, causing `xxx has multiple versions, ensure that there is only one installed` #413

Closed will-yjn closed 3 years ago

will-yjn commented 3 years ago

When installed together with @polkadot/api, there will be many errors:

@polkadot/metadata has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or deupe using your package manager.
The following conflicting packages were found:
        4.2.1   /Users/will/Desktop/lt/node_modules/@polkadot/metadata
        4.2.1   /Users/will/Desktop/lt/node_modules/@substrate/txwrapper/node_modules/@polkadot/metadata
@polkadot/types-known has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or deupe using your package manager.
The following conflicting packages were found:
        4.2.1   /Users/will/Desktop/lt/node_modules/@polkadot/types-known
        4.2.1   /Users/will/Desktop/lt/node_modules/@substrate/txwrapper/node_modules/@polkadot/types-known
@polkadot/types has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or deupe using your package manager.
The following conflicting packages were found:
        4.2.1   /Users/will/Desktop/lt/node_modules/@polkadot/types
        4.2.1   /Users/will/Desktop/lt/node_modules/@substrate/txwrapper/node_modules/@polkadot/types
@polkadot/api has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or deupe using your package manager.
The following conflicting packages were found:
        4.2.1   /Users/will/Desktop/lt/node_modules/@polkadot/api
        4.2.1   /Users/will/Desktop/lt/node_modules/@substrate/txwrapper/node_modules/@polkadot/api
@polkadot/api-derive has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or deupe using your package manager.
The following conflicting packages were found:
        4.2.1   /Users/will/Desktop/lt/node_modules/@polkadot/api-derive
        4.2.1   /Users/will/Desktop/lt/node_modules/@substrate/txwrapper/node_modules/@polkadot/api-derive
@polkadot/rpc-core has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or deupe using your package manager.
The following conflicting packages were found:
        4.2.1   /Users/will/Desktop/lt/node_modules/@polkadot/rpc-core
        4.2.1   /Users/will/Desktop/lt/node_modules/@substrate/txwrapper/node_modules/@polkadot/rpc-core
@polkadot/rpc-provider has multiple versions, ensure that there is only one installed.
Either remove and explicitly install matching versions or deupe using your package manager.
The following conflicting packages were found:
        4.2.1   /Users/will/Desktop/lt/node_modules/@polkadot/rpc-provider
        4.2.1   /Users/will/Desktop/lt/node_modules/@substrate/txwrapper/node_modules/@polkadot/rpc-provider

I definitely need @polkadot/api. But I also need @substrate/txwrapper's functionality to sign transactions offline, and broadcast it later. How do I solve these errors?

emostov commented 3 years ago

I just created a test npm and yarn repo but cannot reproduce this issue. A few ideas to try out though

will-yjn commented 3 years ago

Yes. I deleted the .lock file and it solves the problem. Thank you very much.