I'm following this tutorial - https://www.freecodecamp.org/news/solidity-tutorial-hardhat-nfts/ but when running
npx hardhat test
or
npx hardhat run scripts/deploy.js
I'm getting the following error:
TypeError: Cannot read properties of undefined (reading 'gteHardfork')
at new Transaction (node_modules\@ethereumjs\tx\src\legacyTransaction.ts:111:21)
at new FakeSenderTransaction (node_modules\hardhat\src\internal\hardhat-network\provider\transactions\FakeSenderTransaction.ts:92:5)
at HardhatNode._getFakeTransaction (node_modules\hardhat\src\internal\hardhat-network\provider\node.ts:1118:12)
at HardhatNode.estimateGas (node_modules\hardhat\src\internal\hardhat-network\provider\node.ts:506:27)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at runNextTicks (node:internal/process/task_queues:65:3)
at listOnTimeout (node:internal/timers:526:9)
at processTimers (node:internal/timers:500:7)
at EthModule._estimateGasAction (node_modules\hardhat\src\internal\hardhat-network\provider\modules\eth.ts:421:9)
at HardhatNetworkProvider.request (node_modules\hardhat\src\internal\hardhat-network\provider\provider.ts:99:18)
When I tried the same commands on the repo referenced in the article, everything worked fine there. I've tried matching all the dependency versions and compared my whole project to it, but problem didn't go away.
What can be the reason?