ethers-simple-storage-fcc
ethers-simple-storage-fcc copied to clipboard
Deploying the contract wont work. 7:07:25. Any help would be greatly appreciated.
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.
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.
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.
@mishdgr8 Thank you so much! This worked for me! I appreciate the help! Now I can move forward! Thank you again!
@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
Try this. Worked for me. Solution by Izmanovich https://github.com/PatrickAlphaC/ethers-simple-storage-fcc/issues/17