BLOCKCHAIN/BlockChain

[Geth Private Network] SmartContract 배포 오류 해결 삼만리

yuujoeng 2022. 12. 10. 23:18

(1) node.js 버전 오류

 

- node.js 최신 버전으로 업데이트 후 해결

 

(2) truffle 오류

 

-  배포하는 위치와 동일한 위치에 truffle/hdwallet-provider 삭제 후 재설치하여 해결

 

Error: Cannot find module 'truffle-hdwallet-provider'

I got the following errors while trying to deploy my smart contract: sers-Air:lottery user$ node deploy.js internal/modules/cjs/loader.js:582 throw err; ^ Error: Cannot find module 'tr...

ethereum.stackexchange.com

 

(3) node triggerUncaughtException 에러

넌 또 뭔데..

- 전부 try-catch문으로 수정하라는 방법 뿐이나 이미 try-catch 구조라 geth node 재연결하니 해결

 

How to fix this Problem, node:internal/process/promises:279 -- triggerUncaughtException(err, true /* fromPromise */);

const { exec } = require("child_process"); const executePy = (filepath) => { return new Promise((resolve, reject) => { exec( `python ${filepath}`, (error, stdout,

stackoverflow.com

 

(4) node_modules 에러

 

- 버전을 바꾸고 싶은데요 

 

- truffle init 명령어로 fruffle-config.js 파일 생성

// truffle init 실행 시 ECAC.sol 파일이 사라지므로 이외의 장소에 저장해두기

 

- truffle-config.js 파일에서 solc version 변경

 

- 버전 변경 성공 

// ECAC.sol 돌려놓기

 

- node triggerUncaughtException 에러로 돌아왔음