Can't deploy my script #4844
-
When trying to deploy my script I run into the error "TypeError: Cannot read properties of undefined (reading 'getContractFactory')". I run "yarn hardhat run scripts/deploy.js --network goerli". Below is my deploy.js code // imports const { ethers } = require("hardhat")
// async main
async function main() {
const SimpleStorageFactory = await ethers.getContractFactory(
"SimpleStorage"
)
console.log("Deploying contract...")
const simpleStorage = await SimpleStorageFactory.deploy()
await simpleStorage.deployed()
}
// main
main()
.then(() => process.exit(0))
.catch((error) => {
console.error(error)
process.exit(1)
}) |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Feb 17, 2023
Replies: 1 comment 8 replies
-
@alex81983 Make sure you have ethers installed. If you already have then leave your repo link I will check it. |
Beta Was this translation helpful? Give feedback.
8 replies
Answer selected by
alymurtazamemon
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@alex81983 Make sure you have ethers installed. If you already have then leave your repo link I will check it.