The error you're encountering is caused by having multiple conflicting versions of the @polkadot/util package in your project. To fix this, you can try the following steps:
Delete your node_modules folder and the package-lock.json or yarn.lock file (depending on whether you use npm or yarn) in your project directory:
bash
Copy code
rm -rf node_modules
rm package-lock.json
or for yarn:
bash
Copy code
rm -rf node_modules
rm yarn.lock
Open your package.json file and make sure all the Polkadot dependencies have the same version. For example, if you want to use version 7.0.1 for all Polkadot packages:
json
Copy code
{
"dependencies": {
"@polkadot/api": "^7.0.1",
"@polkadot/keyring": "^7.0.1",
"@polkadot/rpc-augment": "^7.0.1",
"@polkadot/rpc-core": "^7.0.1",
"@polkadot/rpc-provider": "^7.0.1",
"@polkadot/types": "^7.0.1",
"@polkadot/util": "^7.0.1",
"@polkadot/util-crypto": "^7.0.1",
"@polkadot/api-derive": "^7.0.1"
}
}
Note: Replace "7.0.1" with the latest version available on npm.
Run npm install or yarn install to reinstall the dependencies:
bash
Copy code
npm install
or for yarn:
bash
Copy code
yarn install
By following these steps, you should be able to resolve the conflicting package versions in your project.
The error you're encountering is caused by having multiple conflicting versions of the @polkadot/util package in your project. To fix this, you can try the following steps:
Delete your node_modules folder and the package-lock.json or yarn.lock file (depending on whether you use npm or yarn) in your project directory: bash Copy code rm -rf node_modules rm package-lock.json or for yarn:
bash Copy code rm -rf node_modules rm yarn.lock Open your package.json file and make sure all the Polkadot dependencies have the same version. For example, if you want to use version 7.0.1 for all Polkadot packages: json Copy code { "dependencies": { "@polkadot/api": "^7.0.1", "@polkadot/keyring": "^7.0.1", "@polkadot/rpc-augment": "^7.0.1", "@polkadot/rpc-core": "^7.0.1", "@polkadot/rpc-provider": "^7.0.1", "@polkadot/types": "^7.0.1", "@polkadot/util": "^7.0.1", "@polkadot/util-crypto": "^7.0.1", "@polkadot/api-derive": "^7.0.1" } } Note: Replace "7.0.1" with the latest version available on npm.
Run npm install or yarn install to reinstall the dependencies: bash Copy code npm install or for yarn:
bash Copy code yarn install By following these steps, you should be able to resolve the conflicting package versions in your project.