0

Every time I try to use a hardhat command (i.e. npx hardhat test) in my project, I get the following error:

You are using a version of Node.js that is not supported by Hardhat, and it may work incorrectly, or not work at all.

Please, make sure you are using a supported version of Node.js.

To learn more about which versions of Node.js are supported go to https://hardhat.org/nodejs-versions


  0 passing (0ms)

An unexpected error occurred:

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:133:10)
    at hash160 (/Users/mabeloza/abja/abja_webapp/src/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:249:21)
...

  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'

I am using the following Hardhat dependencies in my nodeJS app and am using the nodeJS 18.1.0.

"@nomiclabs/hardhat-ethers": "^2.0.5",
"@nomiclabs/hardhat-etherscan": "^3.0.3",
"@nomiclabs/hardhat-waffle": "^2.0.3",

Which hardhat version should I use to be able to use the latest nodeJS? Or is there a specific nodeJS I need to use for hardhat?

Mabel Oza
  • 557
  • 8
  • 22
  • 1
    According to Hardhat's [documentation](https://hardhat.org/reference/stability-guarantees.html#node-js-versions-support): _"Hardhat supports every currently maintained LTS Node.js version"_. Which means it currently only supports Node.js 14 (maintenance LTS) and 16 (active LTS). – juliomalves May 07 '22 at 21:49

0 Answers0