Joystream / joystream

Joystream Monorepo
http://www.joystream.org
GNU General Public License v3.0
1.42k stars 115 forks source link

package conflics when using txwrapper #5101

Closed mnaamani closed 6 months ago

mnaamani commented 6 months ago

When installing joystream/cli package globally with npm, I'm getting issues running some commands:

npm install -g @joystream/cli

eg. when using the advanced-transactions:constructUnsignedTxInitiateMs

@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 11.1.1  node_modules/@joystream/cli/node_modules/@polkadot/util/cjs
    cjs 12.6.2  node_modules/@joystream/cli/node_modules/@substrate/txwrapper-core/node_modules/@polkadot/util/cjs
@polkadot/rpc-augment 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 10.1.4  node_modules/@joystream/cli/node_modules/@polkadot/rpc-augment/cjs
    cjs 10.12.2 node_modules/@joystream/cli/node_modules/@substrate/txwrapper-core/node_modules/@polkadot/rpc-augment/cjs
@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 11.1.1  node_modules/@joystream/cli/node_modules/@polkadot/util-crypto/cjs
    cjs 12.6.2  node_modules/@joystream/cli/node_modules/@substrate/txwrapper-core/node_modules/@polkadot/util-crypto/cjs
@polkadot/types-codec 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 10.1.4  node_modules/@joystream/cli/node_modules/@polkadot/types-codec/cjs
    cjs 10.12.2 node_modules/@joystream/cli/node_modules/@substrate/txwrapper-core/node_modules/@polkadot/types-codec/cjs
@polkadot/types-create 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 10.1.4  node_modules/@joystream/cli/node_modules/@polkadot/types-create/cjs
    cjs 10.12.2 node_modules/@joystream/cli/node_modules/@substrate/txwrapper-core/node_modules/@polkadot/types-create/cjs
@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 10.1.4  node_modules/@joystream/cli/node_modules/@polkadot/types/cjs
    cjs 10.12.2 node_modules/@joystream/cli/node_modules/@substrate/txwrapper-core/node_modules/@polkadot/types/cjs
@polkadot/keyring 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 11.1.1  node_modules/@joystream/cli/node_modules/@polkadot/keyring/cjs
    cjs 12.6.2  node_modules/@joystream/cli/node_modules/@substrate/txwrapper-core/node_modules/@polkadot/keyring/cjs
@polkadot/types-known 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 10.1.4  node_modules/@joystream/cli/node_modules/@polkadot/types-known/cjs
    cjs 10.12.2 node_modules/@joystream/cli/node_modules/@substrate/txwrapper-core/node_modules/@polkadot/types-known/cjs

command ends with error:

 TypeError: Cannot read properties of undefined (reading 'SpRuntimeUncheckedExtrinsic')

and the output .json is not written to disk.

mnaamani commented 6 months ago

I think to fix it properly we would need to update the polkadot/api to v10.6.1 as per: https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-41-v0-9-42/2828#hammer_and_wrench-tooling-section-6

or revert txwrapper to v5 as in https://forum.polkadot.network/t/polkadot-release-analysis-v0-9-40/2468#hammer_and_wrench-tooling-section-4