Ask a Question
Back to All

const { ethers } = require("hardhat"); Error

After running the command npx hardhat run --network goerli scripts/deploy.js I have this strange error and I am not able to move forward.
Can you help me, please?

[email protected]:~/projects/RTW3-Week7-NFT-Marketplace# npx hardhat run --network goerli scripts/deploy.js
const { ethers } = require("hardhat");

SyntaxError: Identifier 'ethers' has already been declared
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1049:15)
at Module._compile (node:internal/modules/cjs/loader:1084:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1174:10)
at Module.load (node:internal/modules/cjs/loader:998:32)
at Function.Module._load (node:internal/modules/cjs/loader:839:12)
at Function.executeUserEntryPoint as runMain
at node:internal/main/run_main_module:17:47