~/web3js/Stest ❯ truffle develop
This version of µWS is not compatible with your Node.js build:

Error: Cannot find module './uws_darwin_arm64_102.node'
Falling back to a NodeJS implementation; performance may be degraded.


Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:67:19)
    at Object.createHash (node:crypto:135:10)
    at hash160 (/Users/ara/.nvm/versions/node/v17.8.0/lib/node_modules/truffle/build/webpack:/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:249:1)
    at HDKey.set (/Users/ara/.nvm/versions/node/v17.8.0/lib/node_modules/truffle/build/webpack:/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:50:1)
    at Function.HDKey.fromMasterSeed (/Users/ara/.nvm/versions/node/v17.8.0/lib/node_modules/truffle/build/webpack:/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:194:1)
    at Function.fromMasterSeed (/Users/ara/.nvm/versions/node/v17.8.0/lib/node_modules/truffle/build/webpack:/node_modules/ethereumjs-wallet/dist/hdkey.js:19:1)
    at Object.getAccountsInfo (/Users/ara/.nvm/versions/node/v17.8.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/mnemonics/mnemonic.js:48:1)
    at Object.module.exports [as run] (/Users/ara/.nvm/versions/node/v17.8.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/commands/develop/run.js:39:1)
    at runCommand (/Users/ara/.nvm/versions/node/v17.8.0/lib/node_modules/truffle/build/webpack:/packages/core/lib/command-utils.js:190:1)
Truffle v5.5.27 (core: 5.5.27)
Node v17.8.0

위와 같은 에러가 발생했을 땐 간단하게 node version 을 변경하여 해결해주면 된다.

 

~/web3js/Stest ❯ nvm ls
       v16.14.2
->      v17.8.0
        v18.8.0
         system
default -> 17.8.0 (-> v17.8.0)
iojs -> N/A (default)
unstable -> N/A (default)
node -> stable (-> v18.8.0) (default)
stable -> 18.8 (-> v18.8.0) (default)
lts/* -> lts/gallium (-> N/A)
lts/argon -> v4.9.1 (-> N/A)
lts/boron -> v6.17.1 (-> N/A)
lts/carbon -> v8.17.0 (-> N/A)
lts/dubnium -> v10.24.1 (-> N/A)
lts/erbium -> v12.22.12 (-> N/A)
lts/fermium -> v14.20.0 (-> N/A)
lts/gallium -> v16.17.0 (-> N/A)
~/web3js/Stest ❯ nvm use v16.14.2
Now using node v16.14.2 (npm v8.5.0)

 

 

truffle init 을 하면 다음과 같이 생성되야하는데

 - contracts

 - migrations

 - test

 

 - truffle-config.js

 - truffle.js

 

이중 truffle.js 가 생성되지 않았다.

 

이전 truffle 버전에서는 운영체제에 따라 truffle.js, truffle-config.js 로 구분되어 있었는데

최근 트러플 버전에서는 truffle-config.js 하나로 통일되었다.

 

결국, 그냥 버전이 다른 문제!

 

+ Recent posts