0

I am just starting with wasm and ink.

I have installed the following dependency:

npm install -g @astar-network/swanky-cli

I am trying to compile the contract flipper and I get the following warnings and error:

swanky contract compile flipper
@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 10.2.1      node_modules\@astar-network\swanky-cli\node_modules\@astar-network\swanky-core\node_modules\@polkadot\util-crypto\cjs
        cjs 10.2.1      node_modules\@astar-network\swanky-cli\node_modules\@polkadot\keyring\node_modules\@polkadot\util-crypto\cjs
@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 10.2.1      node_modules\@astar-network\swanky-cli\node_modules\@polkadot\util\cjs
        cjs 10.2.6      node_modules\@astar-network\swanky-cli\node_modules\@polkadot\util-crypto\node_modules\@polkadot\util\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 10.2.1      node_modules\@astar-network\swanky-cli\node_modules\@astar-network\swanky-core\node_modules\@polkadot\util-crypto\cjs
        cjs 10.2.1      node_modules\@astar-network\swanky-cli\node_modules\@polkadot\keyring\node_modules\@polkadot\util-crypto\cjs
        cjs 10.2.6      node_modules\@astar-network\swanky-cli\node_modules\@polkadot\util-crypto\cjs
✖ Error Compiling contract

How do I fix the warnings and the error?

2 Answers 2

2

This is a warning by polkadotjs library, and shouldn't affect the compilation.

To get rid of the warning, I suggest installing Swanky the recommended way, by downloading the prebuilt release from Github. If the warning persist, you can run it in an isolated environment, like nix shell or a dev container. (We'll soon have an official one too)

To find out what is really breaking your compilation, run the swanky contract compile command with -v flag.

4
  • There seems to be problems with running swanky installed this way since v.1.0.9 at least for me: swanky-v1.0.9/dist/commands/init/index.js: Cannot find module 'tslib' Commented Feb 2, 2023 at 12:28
  • Yes, there was a problem with the packager that caused issues in 1.0.9. Please use a newer version that fixes it.
    – codespool
    Commented Feb 2, 2023 at 14:12
  • Just to let you know the same problem exists in v1.0.10 - the newest release up to date. Commented Feb 2, 2023 at 14:17
  • 1
    thanks for the report, we're checking it out.
    – codespool
    Commented Feb 2, 2023 at 14:18
-1

Thanks for the reply. I use a windows environment. I do run the command:

swanky contract compile test -v

(test is the contract folder name). But I only get the error: ✖ Error Compiling contract and not more.

There are two ways I try to compile a contract:

swanky init test (create flipper template)

swanky contract compile flipper -v

and

cargo contract new test

swanky contract compile test -v

for both I get the same error.

4
  • This is not actually an answer, please use comments on the question to clarify and/or update the original question.
    – Nuke
    Commented Jan 25, 2023 at 21:30
  • Please let me know as follwing. 1. swanky --version 2. node --version 3. yarn --version 4. Whether have you set "git config" 5. OS version Commented Jan 25, 2023 at 22:28
  • 1. swanky --version: @astar-network/swanky-cli/1.0.7 win32-x64 node-v18.13.0 2. node --version: v18.13.0 3. yarn --version: 1.22.10 4. Windows 10 Home 22H2
    – Sequajaa
    Commented Jan 25, 2023 at 23:02
  • Can you use wsl ubutsu 20.04? Commented Jan 26, 2023 at 10:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.