TypeError: Cannot read properties of undefined (reading 'parseEther')
При запуске моего скрипта deploy.js . Ошибка возникает в строке: < /p>
const amount = ethers.utils.parseEther("1.0");
< /code>
У меня есть: < /p>
const { ethers } = require("hardhat");
В верхней части скрипта, но Ethers все еще кажется не определенным. />[*] node.js 18 < /strong> < /li>
Запуск локальной тестовой сети через NPX Hardhat Node < /code> < /li>
< /ul>
Я уже пробовал: < /p>
- revishing wardhatatring < /li>
Code - Использование require ("ethers") вместо (что вызывает разные проблемы)
- Поисковые форумы и выпуска Github
^
TypeError: Cannot read properties of undefined (reading 'parseEther')
at Object. (.../scripts/deploy.js:8:29)
at Module._compile (node:internal/modules/cjs/loader
at Object..js (node:internal/modules/cjs/loader
at Module.load (node:internal/modules/cjs/loader
at Function._load (node:internal/modules/cjs/loader
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:220:24)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:170:5)
at node:internal/main/run_main_module:36:49
Подробнее здесь: https://stackoverflow.com/questions/796 ... -undefined