Skip to content
This repository has been archived by the owner on May 17, 2024. It is now read-only.

Deploying the contract wont work. 7:07:25. Any help would be greatly appreciated. #63

Open
egutierrez130 opened this issue Feb 9, 2023 · 4 comments

Comments

@egutierrez130
Copy link

Hey all, for some reason, when I run this in the terminal --> node deploy.js
It will not deploy the contract.
It is throwing this TypeError: Cannot read properties of undefined (reading 'JsonRpcProvider')
at main (/Users/edgargutierrez/hh-fcc/ethers-simple-storage-fcc/deploy.js:8:41)
at Object. (/Users/edgargutierrez/hh-fcc/ethers-simple-storage-fcc/deploy.js:18:1)

Any help would be greatly appreciated.
ps. I have redone the lesson and made sure all code is correct. My guess is that something is now outdated since 0.8.7 was a long time ago.

@mishdgr8
Copy link

mishdgr8 commented Feb 9, 2023

The newer version of Ethers seems to be unstable ethers 6.0.2... To solve this error downgrade your ethers version to 5.7.2 by going to your package.json

"ethers": "5.7.2",

now on your cli use npm install [email protected] or yarn add [email protected] depending on your package manager and that should solve your error.

@egutierrez130
Copy link
Author

@mishdgr8 Thank you so much! This worked for me! I appreciate the help! Now I can move forward! Thank you again!

@rohitx01
Copy link

rohitx01 commented Feb 25, 2023

@mishdgr8 @egutierrez130 I did change the ethers version as mentioned but after that its throwing a new error:

Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.2)
    at Logger.makeError (/home/rohit_kumar/prac/ethers-simple-storage/node_modules/@ethersproject/logger/lib/index.js:238:21)
    at Logger.throwError (/home/rohit_kumar/prac/ethers-simple-storage/node_modules/@ethersproject/logger/lib/index.js:247:20)
    at JsonRpcProvider.<anonymous> (/home/rohit_kumar/prac/ethers-simple-storage/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:609:54)
    at step (/home/rohit_kumar/prac/ethers-simple-storage/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)
    at Object.throw (/home/rohit_kumar/prac/ethers-simple-storage/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)
    at rejected (/home/rohit_kumar/prac/ethers-simple-storage/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  reason: 'could not detect network',
  code: 'NETWORK_ERROR',
  event: 'noNetwork'
}

pls help

@DengreSarthak
Copy link

Try this. Worked for me.
Solution by Izmanovich
#17

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants