1

I installed npm install -g ganache-cli on my WSL, but when I entered ganache-cli, it is showing me this error.

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:130:10)
    at p (/home/victorshi/.nvm/versions/node/v17.3.1/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:527949)
    at b.set (/home/victorshi/.nvm/versions/node/v17.3.1/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:528548)
    at Function.b.fromMasterSeed (/home/victorshi/.nvm/versions/node/v17.3.1/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:530917)
    at Function.i.fromMasterSeed (/home/victorshi/.nvm/versions/node/v17.3.1/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:526525)
    at new S (/home/victorshi/.nvm/versions/node/v17.3.1/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:206543)
    at new p (/home/victorshi/.nvm/versions/node/v17.3.1/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:195647)
    at new l (/home/victorshi/.nvm/versions/node/v17.3.1/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:42:13485)
    at Object.create (/home/victorshi/.nvm/versions/node/v17.3.1/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:94:92509)
    at Object.server (/home/victorshi/.nvm/versions/node/v17.3.1/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:38637)
    at Object.<anonymous> (/home/victorshi/.nvm/versions/node/v17.3.1/lib/node_modules/ganache-cli/cli.js:106:22)
    at Module._compile (node:internal/modules/cjs/loader:1097:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)

Why is it giving me this? Can someone please help

1
  • This looks like a bug report and should be posted on the ganache-cli repo
    – Richard
    Commented Jan 17, 2022 at 8:23

1 Answer 1

1

I also ran into this error while trying to run ganache-cli on WSL2.

I found a post with the same issue here: https://stackoverflow.com/a/69699772/6322658

When I ran this command below, ganache-cli started running correctly, but I'm not exactly sure what that export statement does. Take a look at the stackoverflow link and do your own research.

Linux & Mac OS (windows git bash):

export NODE_OPTIONS=--openssl-legacy-provider

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.