const HDWalletProvider = require('truffle-hdwallet-provider');
const Web3 = require('web3');
const provider = new HDWalletProvider( 'passphrase', 'rinkeby.infura.io/v3/mytoken' );
const web3 = new Web3(provider);
const deploy = async () =>{ const accounts = await web3.eth.getAccounts(); } deploy();给出
TypeError:无法读取GetAccountsMethod.afterExecution上未定义的属性“map”
使用的版本:
"solc": "^0.4.24",
"truffle-hdwallet-provider": "^1.0.4",
"web3": "^1.0.0-beta.46" 任何解决办法都应该感激。提前谢谢。
发布于 2021-04-08 09:55:53
您可能需要删除目录中的块菌构建。
rm -R build/发布于 2021-05-07 20:04:58
我遇到了同样的错误,在我的例子中,我意外地导入了dbg.json文件,而不是json文件。
https://ethereum.stackexchange.com/questions/67357
复制相似问题